You can configure or update the OAuth 2.0 token sending strategy of a REST host by using either the query parameter or authorization header strategy.
Starting with vRealize Orchestrator 8.7, you can now use two different strategies for sending an OAuth 2.0 bearer access token when making an OAuth 2.0 authorized request. The default strategy, used in previous product versions, is to send the token in a
oauth_token
query parameter when making requests to the host. Using the query parameter strategy can introduce certain vulnerabilities, such as having the REST host server log the incoming requests.
Note: The query parameter will be deprecated in a future vRealize Orchestrator release.
The newly introduced and recommended strategy is to use the Authorization header to send the token when making request to the host.
You can configure either token sending strategy by:
- Using the OAuth 2.0 tab used in built-in REST workflows such as Add a REST Host or Update a REST Host. For an example of using this option when running the Add a REST Host workflow, see Add a REST Host.
- Changing the authorization strategy by adding custom scripting to your workflow.
The scripting approach uses the following methods:
Token sending strategy | Scripting |
Authorization header | host.authentication = RESTAuthenticationManager.createAuthentication("OAuth 2.0", ["<token>", "Authorization header"]); |
Query parameter | host.authentication = RESTAuthenticationManager.createAuthentication("OAuth 2.0", ["<token>", "Query parameter"]); |
Note: The old scripting approach of creating an OAuth 2.0 authentication by passing only the token parameter without a token sending strategy still works, and for backwards compatibility preserves the past behavior of using the query parameter strategy.
host.authentication = RESTAuthenticationManager.createAuthentication("OAuth 2.0", ["<token>"]);
To demonstrate the scripting approach to managing your REST host authorization strategy, the following procedure presents a sample use case of creating a workflow which can be used for switching authorization strategies.
Procedure
What to do next
You can verify what token sending strategy your REST host uses by navigating to Authorization entry.
, selecting your host, and checking the