com.luckymarmot.OAuth2DynamicValue
Argument:
grantType: number: ``0`` (Authorization Code)
The OAuth 2 Grant Type (0: AuthorizationCode, 1: Implict, 2: Resource Owner Password Credentials, 3: Client Credentials).
0
(Authorization Code)
Argument: clientID: DynamicString: None
The Client ID given by the provider (client credentials).
Argument: clientSecret: DynamicString: None
The Client Secret given by the provider (client credentials). Not applicable for Implict grant type.
Argument:
sendClientCredentialsInBody: bool: ``false``
Whether client credentials should be sent in the Authorization header using HTTP Basic Auth (recommended) or in the request body. Not applicable for Implict grant type.
false
Argument: username: DynamicString: None
The Username given by the provider (client credentials). For Resource Owner Password Credentials grant type only.
Argument: password: DynamicString: None
The Password given by the provider (client credentials). For Resource Owner Password Credentials grant type only.
Argument: authorizationURL: DynamicString: None
The Authorization URL given by the provider. Only for Authorization Code and Implict grant types.
Argument: accessTokenURL: DynamicString: None
The Access Token URL of the web page the OAuth service (aka. provider) would normally bring users so they can authorize the access. Not applicable for Implict grant type.
Argument: callbackURL: DynamicString: None
Also known as the Redirect URL, it’s the URL you’ve setup in the OAuth provider’s settings. It should be the URL of a web page on your server, where users will be redirected after authorization process. Only for Authorization Code and Implict grant types.
Argument:
explicitCallbackURL: bool: ``true``
Whether the Redirect URL should be specified in requests. Only for Authorization Code and Implict grant types.
true
Argument: scope: DynamicString: None
The OAuth scope as indicated by the provider.
Argument: stateNonce: DynamicString: None
An unique identifier. Only for Authorization Code and Implict grant types.
Argument: strict: bool: None
Whether additional checks should be performed on responses.
Argument:
tokenPrefix: DynamicString: ``Bearer``
The Token prefix.
Bearer
Argument: token: DynamicString: None
The Access Token obtained from the provider.
function evaluate(context){
var dv = new DynamicValue('com.luckymarmot.OAuth2DynamicValue', {
grantType: 0 /* = Authorization Code Grant */,
clientID: '12345',
clientSecret: '67890',
authorizationURL: 'https://github.com/login/oauth/authorize',
accessTokenURL: 'https://github.com/login/oauth/authorize',
scope: 'repo, user'
});
return dv.getEvaluatedString();
};