java.lang.Object
org.mule.runtime.extension.api.connectivity.oauth.AuthorizationCodeGrantType
All Implemented Interfaces:
org.mule.runtime.api.meta.NamedObject, OAuthGrantType

public final class AuthorizationCodeGrantType extends Object implements OAuthGrantType
Implementation of which contains information about how to use the Authorization-Code grant type against a particular OAuth provider
Since:
1.0
  • Field Details

  • Constructor Details

    • AuthorizationCodeGrantType

      public AuthorizationCodeGrantType(String accessTokenUrl, String authorizationUrl, String accessTokenExpr, String expirationRegex, String refreshTokenExpr, String defaultScope)
      Creates a new instance
      Parameters:
      accessTokenUrl - The url of the access token endpoint
      authorizationUrl - The url of the authorization endpoint which initiates the dance
      accessTokenExpr - Expression used to extract the access token from the accessTokenUrl response
      expirationRegex - Expression used to extract the expiration from the accessTokenUrl response
      refreshTokenExpr - Expression used to extract the refresh token from the accessTokenUrl response
      defaultScope - The default scopes to be request
    • AuthorizationCodeGrantType

      public AuthorizationCodeGrantType(String accessTokenUrl, String authorizationUrl, String accessTokenExpr, String expirationRegex, String refreshTokenExpr, String defaultScope, CredentialsPlacement credentialsPlacement, boolean includeRedirectUriInRefreshTokenRequest)
      Creates a new instance
      Parameters:
      accessTokenUrl - The url of the access token endpoint
      authorizationUrl - The url of the authorization endpoint which initiates the dance
      accessTokenExpr - Expression used to extract the access token from the accessTokenUrl response
      expirationRegex - Expression used to extract the expiration from the accessTokenUrl response
      refreshTokenExpr - Expression used to extract the refresh token from the accessTokenUrl response
      defaultScope - The default scopes to be request
      credentialsPlacement - The place where the credentials will be sent on the token request
      includeRedirectUriInRefreshTokenRequest - Indicates whether the redirect_uri parameter should be included in the refresh token request
      Since:
      1.4.0
  • Method Details

    • accept

      public void accept(OAuthGrantTypeVisitor visitor)
      Description copied from interface: OAuthGrantType
      Accepts a visitor
      Specified by:
      accept in interface OAuthGrantType
      Parameters:
      visitor - an OAuthGrantTypeVisitor
    • getName

      public String getName()
      Specified by:
      getName in interface org.mule.runtime.api.meta.NamedObject
    • getAccessTokenUrl

      public String getAccessTokenUrl()
      Returns:
      The url of the access token endpoint
    • getAuthorizationUrl

      public String getAuthorizationUrl()
      Returns:
      The url of the authorization endpoint which initiates the dance
    • getAccessTokenExpr

      public String getAccessTokenExpr()
      Specified by:
      getAccessTokenExpr in interface OAuthGrantType
      Returns:
      Expression used to extract the access token from the accessTokenUrl response
    • getExpirationRegex

      public String getExpirationRegex()
      Specified by:
      getExpirationRegex in interface OAuthGrantType
      Returns:
      Expression used to extract the expiration from the accessTokenUrl response
    • getRefreshTokenExpr

      public String getRefreshTokenExpr()
      Returns:
      Expression used to extract the refresh token from the accessTokenUrl response
    • getDefaultScope

      public Optional<String> getDefaultScope()
      Returns:
      The default scopes to be requested
    • getCredentialsPlacement

      public CredentialsPlacement getCredentialsPlacement()
      Returns:
      the place where credentials will be sent for the token request
      Since:
      1.4.0
    • includeRedirectUriInRefreshTokenRequest

      public boolean includeRedirectUriInRefreshTokenRequest()
      Returns:
      whether the request_uri parameter should be included in the refresh token request
      Since:
      1.4.0