Hi Everyone, I want to use a back end REST service(for exampe the service name is SendEmail). Before my API proxy hits the target endpoint SendEmail, it needs to hit another target endpoint (for example the service name is AccessToken) to get an access token string. My API proxy will then add an "Authorization" header to contain the token string and hit the SendEmail endpoint with the original REST payload from the client request.
I'd really appreciate if someone can give me help or guide me on how to do this in a single API proxy. I'm looking for advises on the following key tasks:
- Construct a get access token REST request with JSON payload.
- Call the AccessToken endpoint and capture the token string from the response, store it some where.
- Add the "Authorization" header containing the token string to the original SendEmail request.
- Call the SendEmail endpoint.
Solved! Go to Solution.
@Chung Pham you can easily achieve this by using the following policies:
Depending on your actual usecase you might even find this article to be helpful: https://docs.apigee.com/api-platform/security/oauth/use-third-party-oauth-system