Skip to main content

Groovy Script

Explanation

This script performs the following operations:
  1. Finding Token: Finds the access_token field from request body
  2. Extracting Token: Extracts the token value
  3. Adding Header: Adds it to Authorization header as Bearer token
This script should be run on the request line (Request Policy) because it uses the requestBodyTextFromClient and requestHeaderMapToTargetAPI variables.