aws-amplify / aws-amplify/docs

Add callout for Auth.currentAuthenticatedUser not including user data unless aws.cognito.signin.user.admin is included in access token

Open
#4,378 0 comments 0 reactions 1 assignee Claimed by @chrisbonifacio View on GitHub
amplify/js auth needs-clarification OAuth
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

**Describe the bug**
Auth.currentAuthenticatedUser does not include user attributes and/or metadata unless the user's access token includes the `aws.cognito.signin.user.admin` scope.

**To Reproduce**
Steps to reproduce the behavior:
1. Configure OAuth flow for a social provider, omitting the `aws.cognito.signin.user.admin` scope
2. Call `Auth.currentAuthenticatedUser` and try to access attributes from it
3. Observe no attributes present
4. If Amplify.Logger is enabled, you will see this printed to the console

Screen Shot 2022-06-09 at 11 09 08 AM

**Expected behavior**
There should be a callout in the documentation for Auth.currentAuthenticatedUser describing this behavior and why the scope is needed

**Additional context**
Related to https://github.com/aws-amplify/amplify-js/issues/9972

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.