I am looking a way to replace the AccessToken on the Request (Bearer) and replace with the token stored in the attributes. How Can I accomplish that?

Not applicable

murali.boyapati@epsilon.com

Solved Solved
0 2 764
1 ACCEPTED SOLUTION

Hi Murali, Maybe this will help. You can get/set access token attributes with the get/setOAuthV2Info policies. For an overview, see: http://apigee.com/docs/api-services/content/customizing-access-tokens and http://apigee.com/docs/api-services/reference/get-oauth-v2-info-policy

You can use the AssignMessage policy to set request headers. Here are details:

http://apigee.com/docs/api-services/reference/assign-message-policy

View solution in original post

2 REPLIES 2

Hi Murali, Maybe this will help. You can get/set access token attributes with the get/setOAuthV2Info policies. For an overview, see: http://apigee.com/docs/api-services/content/customizing-access-tokens and http://apigee.com/docs/api-services/reference/get-oauth-v2-info-policy

You can use the AssignMessage policy to set request headers. Here are details:

http://apigee.com/docs/api-services/reference/assign-message-policy

Thanks wwitman.

I did JavaScript policy to format the authorization header and used Assign Message Policy to set the Authorization header and it worked like a charm.

var openAMToken = "Bearer " + context.getVariable("accesstoken.OpenAM_access_token"); context.setVariable("openAMToken", openAMToken);

and

<Set> <Headers> <Header name="Authorization">OpenAMToken</Header> </Headers> </Set>