- Newest
- Most votes
- Most comments
Did you add the token to the Authorization header with a "Bearer " prefix? If you did, I suggest that you enable execution logs on the API and check why it is failing.
Hi
we are getting a below URL after Cognito signing
and output is {"message":"Unauthorized"}
please advise if this is correct
This is not correct. The token should be added to the Authorization header like this: Authorization: Bearer id_token (or maybe the access token)
Hi
Below is our Cognito URL which provides us sign in page
the output of the above URL is below the URL
we are not changing anything here
please advise
Thanks
Please take a look at this page - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-enable-cognito-user-pool.html
Are you sending an identity token or an access token in the Authorization header in the request to API Gateway?
If you are sending the access token, you need to specify OAuth Scopes? Can you check if you have configured that in the API Gateway methods where you are enabling Cognito User Pools based authentication?
HI
We are sending an identity token. below are the details
Cognito URL which provides us sign in page
the output of the above URL is below the URL
we have configured that in the API Gateway methods with Cognito User Pools-based authentication. below are details
MyAuthorizer Authorizer ID: m9a1oe Cognito User Pool MyFirstUserPool - TpeUcTTj1 (us-east-1) Token Source Authorizaton
Token Validation
please advise
Thanks
Once the user signs in to the Cognito login page, the front-end application needs to include the generated token either identity or access token in the header of the API call to API Gateway using the header Authorization, as Uri explained. Are you doing that?
We have a good hands-on workshop that gives you a good feel of how you can make Cognito work with API Gateway - https://auth.serverlessworkshops.io/setup.html
Hi
we have tried all possible ways, but are still struggling to fix it.
please advise some solution
Thanks Siddharth Maheshwari
Relevant content
- Accepted Answerasked 3 months ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Porbably you facing the same issue https://repost.aws/questions/QUzf0Jka7rTHi4AkZ4G8YmzA#AN7qxwmkUUQFKVQIrmhV4Edg