question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"No Current User" with Cognito User Pools for accessing App Sync

See original GitHub issue

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

API

** What AWS Services are you utilizing? **

Cognito and App Sync

** Provide additional details e.g. code snippets **

I used Coginto User Pools for accessing my App Sync.

I have added below code in my unauth role IAM policy, but I still get No current user

    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "appsync:GraphQL",
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "appsync:GetDataSource",
                "appsync:GetGraphqlApi",
                "appsync:GetFunction"
            ],
            "Resource": "*"
        }
    ]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
elorzafecommented, Apr 3, 2019

@idiglove The problem is this, when is configured AMAZON_COGNITO_USER_POOLS as auth type for AppSync, Amplify is trying to get the user that is currently logged in. That is the reason you are seeing No current user error.

In order to allow unauthenticated user to access your API, you need to change it to AWS_IAM. And add policy for query your api.

0reactions
github-actions[bot]commented, Jun 12, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"No current user": Isn't it even possible to make unauth calls to ...
"No current user": Isn't it even possible to make unauth calls to AWS AppSync through Amplify with authentication type AMAZON_COGNITO_USER_POOLS ...
Read more >
Authorization and authentication - AWS AppSync
Learn about authentication and authorization in AWS AppSync. ... You can use multiple Amazon Cognito User Pools and OpenID Connect providers.
Read more >
How to use Cognito with AppSync - Advanced Web Machinery
AppSync integrates with Cognito User Pools, which makes it easy to add sign-in (and sign-up) functionality to an API.
Read more >
Part 05: AWS AppSync: Guest/Unauthenticated User Access ...
Learn how to provide Guest/Unauthenticated User Access to your backend AppSync API with Cognito Identity Pool Join "The Complete Guide to ...
Read more >
access Cognito User Pool secured AppSync app via alternate ...
I have an AppSync app currently configured to use the "Amazon Cognito User Pool" Authorization Type. This works great and I love it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found