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 OAuthOAuth A standard framework that enables an application (OAuth client) to obtain access tokens from an OAuth authorization server for the purpose of retrieving protected resources on a resource server. 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.