Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

unmask and return value in response

Hello ApigeeExperts/ @dchiesa1 

Trying to return "Authorization" and its value in response headers to clientapplication, currently it is being masked and value is returned as "XXXXXX" while the same value is appended to a different header key it is being returned as expected. Can i please have the steps to overcome this.

0 2 125
2 REPLIES 2

Hey @jaysudo,

I believe you're referring to the masking of the value in the Apigee Trace/Debug tool, correct? This is expected behaviour because the Authorization header contains sensitive data and is one of the only headers that Apigee masks by default.

Even though you see it masked (as "*******") during debugging, this does not mean that it will be returned as asterisks to the client. The client will receive the actual value of the Authorization header unless there is specific logic in your proxy or policies that modifies it before sending the response.

I also want to pay your attention to the fact that in general, returning the Authorization header to the client is not the best practice. This header is meant for the client to send authentication information to the server, not the other way around. Its primary purpose is to facilitate the authentication process where the client proves its identity to the server. Sending this header back to the client can create confusion and potential misuse.

Additionally, reassigning it to another header could potentially expose access tokens contained within, which could lead to significant security vulnerabilities. This practice can make sensitive data accessible in places where it should not be, increasing the risk of token leakage or unauthorised access.

Be cautious when handling or exposing headers containing sensitive authentication information.

Hope this helps clarify things!

Hi @jaysudo - Thank you for engaging, and a big thank you to @nmarkevich for providing a reply. 😉

If this resolves your question, feel free to mark the response as an accepted solution to help others who might have a similar query.

We also encourage you to explore our latest articles , we’ve been publishing new content that we hope you’ll find valuable.