Amplify-js: Run query in AppSync console returns UnauthorizedException

Created on 15 Nov 2018  路  4Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *
AppSync console

* What AWS Services are you utilizing? *
AppSync

* Provide additional details e.g. code snippets *
Whatever query I run in https://us-west-2.console.aws.amazon.com/appsync/home?region=us-west-2#/xxx/v1/queries, I get:

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

In amplify I configure to use User Pools and I can find registered users of my app in User Pools console. I also try "Login with User Pools" but I cannot find the User Pool client ID.

question

Most helpful comment

Open AWS AppSync
Select your api (followed by environment ID)
Click Run a query
Click Login with User Pools
Copy your aws_user_pools_web_client_id to ClientId
Sign in with credentials from an account you've created
Now you can run queries

All 4 comments

I could only find the client id when tracing cognito user information that was returned from the Auth API after sign in.

@YikSanChan are you using amplify-cli?, If that is the case, you can look the userpool client id on aws-exports.js file on aws_user_pools_web_client_id param.

@YikSanChan are you using amplify-cli?, If that is the case, you can look the userpool client id on aws-exports.js file on aws_user_pools_web_client_id param.

It solves the problem! Is it recommended to contribute by adding a brief instruction on https://aws-amplify.github.io/docs/js/react? I will be happy to do this, as users like me do want to directly query the GraphQL backend even before writing any app code!

Open AWS AppSync
Select your api (followed by environment ID)
Click Run a query
Click Login with User Pools
Copy your aws_user_pools_web_client_id to ClientId
Sign in with credentials from an account you've created
Now you can run queries

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josoroma picture josoroma  路  3Comments

TheRealRed7 picture TheRealRed7  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

leantide picture leantide  路  3Comments

cosmosof picture cosmosof  路  3Comments