Search in sources :

Example 1 with OAuthModelProperty

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)));
    });
}
Also used : AuthorizationCode(org.mule.runtime.extension.api.annotation.connectivity.oauth.AuthorizationCode) AuthorizationCodeGrantType(org.mule.runtime.extension.api.connectivity.oauth.AuthorizationCodeGrantType) OAuthModelProperty(org.mule.runtime.extension.api.connectivity.oauth.OAuthModelProperty)

Aggregations

AuthorizationCode (org.mule.runtime.extension.api.annotation.connectivity.oauth.AuthorizationCode)1 AuthorizationCodeGrantType (org.mule.runtime.extension.api.connectivity.oauth.AuthorizationCodeGrantType)1 OAuthModelProperty (org.mule.runtime.extension.api.connectivity.oauth.OAuthModelProperty)1