user1354825
user1354825

Reputation: 1541

Appsync graphql authorization with cognito

I enabled cognito as the only authorization mechanism (removed api key).

Following this document, I was able to enable authorization:- https://aws.amazon.com/blogs/mobile/graphql-security-appsync-amplify/

But for some reason unknown to me, i am getting the below error on postman:-

{
    "errors": [
        {
            "errorType": "UnauthorizedException",
            "message": "Unable to parse JWT token."
        }
    ]
}

I used Bearer Token for Authorization which i generated as below :-

aws cognito-idp admin-initiate-auth --auth-flow ADMIN_USER_PASSWORD_AUTH --client-id 12345678asda9876eia --region something-west-1 --auth-parameters [email protected],PASSWORD=somepass --user-pool-id something-west-1_ABCdefAmn

Upvotes: 2

Views: 1223

Answers (1)

user1354825
user1354825

Reputation: 1541

Works after removing "Bearer" from the authorization token in postman.

Upvotes: 0

Related Questions