I am using Amazon Cognito, API Gateway and Elastic Beanstalk (ELB) to create a micro services application.
The flow is the following:
- I sign-in in my cognito UI
- Cognito redirects me to my API Gateway URL. (There are id_token and access_token hash parameters in addition to the redirection URL:
https://<redirection_url>#id_token=<id_token>&access_token=<access_token>
) - The API Gateway checks for an Authorization header, and if the Bearer token that corresponds is approved, I am re-directed to the right URL.
My problem: I don't have any logic that can retrieve the access token and the id token from the hash parameters, and set that in my Authorization header. As a consequence, I always have a 401 error "Unauthorized"
in the step 3. How can I fix it?