OAuth 2.0 Scopes Policy Script API Functionality
In addition to the functionality provided by "Accessing HTTP Services" and "Debug Logging", scripted OAuth 2.0 policy condition scripts can access some environment properties relating to the authorization request.
This information can then be returned as needed in the response to an authorization request:
Object | Type | Description |
---|---|---|
| | Return |
| | Describe the environment passed from the client making the authorization request. For example, the following shows an "environment": { "clientId": [ "MyOAuth2Client" ] } |
The following JavaScript writes the ID of the OAuth 2.0 client to the debug log, and then authorizes the request:
logger.message("Client ID: " + environment.get("clientId")); authorized=true;