Page created: 26 Jul 2021
|
Page updated: 14 Jan 2022
Access the PolicyContext object in Groovy policyCtx
.
Purpose
The PolicyContext object is a map of objects needed to perform policy decisions. The
contents of the map vary based on the context of the current user flow. A common
example is OAuth token information stored in an OAuthToken object contained within
the context map. In this example, an OAuthToken object is retrieved from the policy
context by using the oauth_token
key. The OAuthToken object is
available only for the OAuth Groovy scripts rules.
Groovy sample
def oauthToken = policyCtx?.context.get("oauth_token")
Method summary
Method | Description |
---|---|
objectMap<String, Object> getContext() | Container for the OAuthToken. |
Exchange getExchange() | Returns the exchange a message relates to. |