org.mule.api.annotations.oauth
Annotation Type OAuth2


@Target(value=TYPE)
@Retention(value=SOURCE)
@Documented
public @interface OAuth2

The class annotated with OAuth2 is applied to an Connector that uses the OAuth 2.0 a protocol for authentication. Basic information about the Service Provider is required to go through the OAuth flow.


Required Element Summary
 String accessTokenUrl
          The URL defined by the Service Provider used to obtain an Access Token
 String authorizationUrl
          The URL defined by the Service Provider where the Resource Owner will be redirected to grant authorization to the Consumer
 
Optional Element Summary
 String accessTokenRegex
          A Java regular expression used to extract the Access Token from the Service Provider response.
 OAuthAuthorizationParameter[] authorizationParameters
          Extra authorization parameters that will be appended as a query string arguments when building the authorization URL.
 String expirationRegex
          A Java regular expression used to extract the expiration time of the Access Token (in seconds) from the Service Provider response.
 org.mule.security.oauth.OnNoTokenPolicy onNoTokenPolicy
           
 String refreshTokenRegex
          A Java regular expression used to extract the Refresh Token from the Service Provider response.
 String verifierRegex
          A Java regular expression used to extract the verifier from the Service Provider response as a result of the Resource Owner authorizing the Consumer.
 

Element Detail

accessTokenUrl

public abstract String accessTokenUrl
The URL defined by the Service Provider used to obtain an Access Token


authorizationUrl

public abstract String authorizationUrl
The URL defined by the Service Provider where the Resource Owner will be redirected to grant authorization to the Consumer

verifierRegex

public abstract String verifierRegex
A Java regular expression used to extract the verifier from the Service Provider response as a result of the Resource Owner authorizing the Consumer.

Default:
"code=([^&]+)"

accessTokenRegex

public abstract String accessTokenRegex
A Java regular expression used to extract the Access Token from the Service Provider response.

Default:
"\"access_token\":\"([^&]+?)\""

expirationRegex

public abstract String expirationRegex
A Java regular expression used to extract the expiration time of the Access Token (in seconds) from the Service Provider response. If the this regular expression is not found in the Service Provider response (whether the regular expression is wrong or the Access Token never expires), the Access Token will be treated as if it would never expire.

Default:
"\"expires_in\":([^&]+?),"

refreshTokenRegex

public abstract String refreshTokenRegex
A Java regular expression used to extract the Refresh Token from the Service Provider response.

Default:
"\"refresh_token\":\"([^&]+?)\""

authorizationParameters

public abstract OAuthAuthorizationParameter[] authorizationParameters
Extra authorization parameters that will be appended as a query string arguments when building the authorization URL.

Default:
{}

onNoTokenPolicy

public abstract org.mule.security.oauth.OnNoTokenPolicy onNoTokenPolicy
Default:
org.mule.security.oauth.OnNoTokenPolicy.EXCEPTION


Copyright © 2010–2015 MuleSoft, Inc.. All rights reserved.