The API gateway plugin provides data and metadata to the Sideband API about HTTP requests received from a client and HTTP responses received from an API server.
When the Sideband API handles an API server's HTTP response, you can enable the API gateway plugin to also provide data and metadata for the original HTTP request, which can be used to make policy decisions. For example, data about access token claims and the token owner are request data, but they might be useful when authorizing an HTTP response.
The Sideband API provides two methods to supply HTTP request data during HTTP response processing. Select a method according to the API gateway plugin's capabilities. By default, both methods are disabled. You can enable them by configuring the request-context-method property of the Sideband API HTTP Servlet Extension.
- Request context using the state field
When enabled, the Sideband API adds a
statefield to its responses for inbound HTTP requests. This field contains an encoded form of the request data, including preprocessed authentication data, such as access token claims and token owner attributes. The API gateway plugin is expected to provide this state data when it next makes a request corresponding to the outbound HTTP response. The Sideband API can then pass this data about the HTTP request in its policy request.
As the state data includes preprocessed authentication information, this information can be made available for policy processing without the overhead of re-invoking an access token validator. However, the size of the state data is proportional to the size of the original HTTP request.To enable this option, use the following command:
PingAuthorize/bin/dsconfig \ set-http-servlet-extension-prop \ --extension-name "Sideband API" \ --set request-context-method:state
- Request context using the request field
When enabled, an API gateway plugin making a request to handle an outbound HTTP response provides all data about the original HTTP request in the
requestfield. If this data includes an
Authorizationheader with a bearer token, the Sideband API invokes its access token validators to produce a set of access token claims and token owner attributes, which are then made available in the policy request.To enable this option, use the following command:
PingAuthorize/bin/dsconfig \ set-http-servlet-extension-prop \ --extension-name "Sideband API" \ --set request-context-method:request
- Disabling request context handling
The request context feature is disabled by default. If you have enabled it, you can disable it with the following command:
PingAuthorize/bin/dsconfig \ set-http-servlet-extension-prop \ --extension-name "Sideband API" \ --reset request-context-method