I am new to APIGEE and have the following use case -
please help me on this .
Hello,
I would recommend the use of the Assign Message Policy (noted here: https://cloud.google.com/apigee/docs/api-platform/reference/policies/assign-message-policy) to support your use case. By using the assign message policy, you would be able to remove/rewrite headers based on incoming key/value pairs (for your use case this would be the custom auth header information)
There are a ton of examples as per implementation within the document noted - if you have any specific questions/concerns please let us know!
A single AssignMessage policy to do the things OP mentioned (assign the value of one header to another, remove the custom auth header) would look like this:
<AssignMessage name='AM-Reassign-Headers'>
<Set>
<Headers>
<Header name='Authorization'>{request.header.CustomAuthHeader}</Header>
</Headers>
</Set>
<Remove>
<Headers>
<Header name='CustomAuthHeader'/>
</Headers>
<Remove>
</AssignMessage>
I guess you will make sure to validate the Basic Auth header before over-writing it with this policy.