SteevenMurthan
Intern
Intern
  • UID11800
  • Fans0
  • Follows0
  • Posts7
Reads:610Replies:1

401 Error

Created#
More Posted time:Nov 12, 2021 15:56 PM
How can I troubleshoot "401 Unauthorized" errors from an API Gateway REST API endpoint once I've set up an Cognito user pool? I tried to set up my Cognito user pool as a Cognito user pool on my  API Gateway REST API. Now I get "401 Unauthorized" errors in the API response. How can I troubleshoot these errors?


Id token payload:
 {
 "sub": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
 "aud": "xxxxxxxxxxxxexample",
 "email_verified": true,
 "token_use": "id",
 "auth_time": 1500009400,
 "iss": "https://cognito-idp.us-east-1.com/us-east-1_example",
 "cognito:username": "janedoe",
 "exp": 1500013000,
 "given_name": "Jane",
 "iat": 1500009400,
 "email": "janedoe@example.com"
 
These errors came through my online classes of AWS DevOps certification.
Access token payload:
    "auth_time": 1500009400,
    "exp": 1500013000,
    "iat": 1500009400,
    "iss": "https://cognito-idp.us-east-1.com/us-east-1_i",
    "scope": "aws.cognito.signin.user.admin",
    "sub": "aaaaaaaa-bbbb-cccc-dddd-5555555e",
    "token_use": "access",
    "username": "janedoe@example.com"
}

afzaalvirgoboy
Assistant Engineer
Assistant Engineer
  • UID6091
  • Fans2
  • Follows0
  • Posts52
1st Reply#
Posted time:Nov 15, 2021 6:59 AM
Hi,
How are you trying to pass the authentication token/credential in the SDK?
Guest