Special Syntax to be followed while using OAuth2 shared token adaptor in order to be chained with other connector/adaptors.
book
Article ID: KB0075912
calendar_today
Updated On:
Products
Versions
TIBCO Cloud API Management
-
Description
Lets learn how to use the special syntax in order to chain the OAuth2 Tokens Across API Definitions Connector/Adapter.
Issue/Introduction
There is a special syntax that needs to be followed when a customer is using OAuth2 shared token adaptor along with other connector/adaptors. This special syntax needs to be used only when OAuth2 shared token adaptor is involved. Otherwise the chaining process remains the same as specified in mashery documentation for all other adaptor/connector chaining other than OAuth2.
Environment
ANY
Resolution
1. The OAuth2 Tokens Across API Definitions Connector/Adapter requires some unique syntax in order to be able to chain with other adapters
2. Under the Processing Adapter field, enter the following: “com.mashery.proxy.customer.generic.oauth2-shared-token-adapter” even though only this single adapter name is used, the adapter is “smart” enough to allow chaining of other connector/adapters.
3. When you are ready for the chain to be active, change the Perform Pre-Processing to enabled
4. The “Data to make available for pre-processing” field is used to specify the connectors/adapters that will be chained and the necessary configuration details. The syntax is the following:
4a. Add a line for the service_ID of the “parent” API Definition from which tokens will be able to be utilized shared_token_spkey:<service_ID_goes_here>
4b. Add a line called processers: and put a comma-delimited list of only the additional of the connectors/adapters that will form the chain immediately following the colon (do not include the “com.mashery.proxy.customer.generic.oauth2-shared-token-adapter” in the list.
processors:PROCESSOR1,PROCESSOR22.
4c. In the subsequent lines, put the names of the connector/adapter with the configuration field followed by the configuration data for the the additional of the connectors/adapters that will form the chain. PROCCESSOR1.parameter:value PROCCESSOR1.parameter:value PROCCESSOR2.parameter:value PROCCESSOR2.parameter:value
For example, if you wanted to chain first two connector/adapter examples in this article (OAuth2 Tokens Across API Definitions Connector/Adapter and HTTP Header Injection of Static Values) you would use the following in the “Data to make available for pre-processing” field: shared_token_spkey:<service_ID_goes_here> processors:com.mashery.proxy.core.add-headers-processor com.mashery.proxy.core.add-headers-processor.x-api-platform:mashery