use of org.mule.runtime.extension.api.connectivity.oauth.OAuthModelProperty in project mule by mulesoft.
the class ConnectionProviderModelLoaderDelegate method parseOAuthGrantType.
private void parseOAuthGrantType(ConnectionProviderElement providerType, ConnectionProviderDeclarer providerDeclarer) {
providerType.getAnnotation(AuthorizationCode.class).ifPresent(a -> {
AuthorizationCodeGrantType grantType = new AuthorizationCodeGrantType(a.accessTokenUrl(), a.authorizationUrl(), a.accessTokenExpr(), a.expirationExpr(), a.refreshTokenExpr(), a.defaultScopes());
providerDeclarer.withModelProperty(new OAuthModelProperty(asList(grantType)));
});
}
Aggregations