0

I am using an AWS proxy ApiGateway that is mapped to a lambda function that is hosting a REST Api. Everything is wired up and functioning, except I see that responses from the server are remapping my 'Authorization' header to 'x-amzn-remapped-authorization', which is causing problems for web clients that are looking for the 'Authorization' key in the response headers.

I picked a proxy integration setup because I don't want Amazon to do anything special, just serve requests. I realize that I could tell the clients to read the remapped key, but that is bending to accomidate Amazon's 'decision'. I think I have correctly set CORS to properly expose the Authorization header, and I have the 'Lambda proxy integration' option turned on in the Api gateway. Is something I am missing to disable this remapping?

8
  • 1
    Authorization is a request header, you shouldn't have it in your responses anyway? Commented Apr 10 at 0:22
  • Authorization is indeed a header that should appear in responses, as I explicitly add it in code with a bearer token as a value. However, when it apprives at the client, it has been renamed 'x-amzn-remapped-authorization'. That is the problem that I am trying to fix. Commented Apr 10 at 0:53
  • So you're aware that you're using it in a non-standard way? Commented Apr 10 at 8:31
  • How is this non-standard? Authorization headers are a very common method to pass tokens around. I am trying to do this in the most standard way possible. Commented Apr 10 at 17:30
  • 1
    Authorization headers on requests, yes. On responses, no. Commented Apr 10 at 17:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.