Amplify Authenticator not returning "attributes" on inital login
See original GitHub issueDescribe the bug When logging in initially via Authenticator, the auth-info coming from authStateChange$ lacks the “attributes” node, containing user info from the Cognito-Pool. When reloading the app (the authenticator automaticall logs the user back in) the auth-info contains the “attributes” node (along with all the custom attributes set for that cognito pool)
To Reproduce
- register to the authStateChange$-observable
- login via the authenticator
- print the incoming auth-info
Expected behavior The “attributes”-node should be present right from the very first login.
Screenshots First Login (see “signedOut”-state)
Browser refresh (secondary [automatic] login)
Desktop (please complete the following information):
- OS: Windows 10
- Browser Chrome
- Version 72.0.3626.121
Sample code
// AmplifyService loaded into "my" angular-session-service via DI
import { Injectable } from '@angular/core';
import { AmplifyService } from 'aws-amplify-angular';
@Injectable({
providedIn: 'root'
})
export class SessionService {
constructor (private amplifyService: AmplifyService) {
this.amplifyService.authStateChange$.subscribe((authInfo) => {
console.log(authInfo);
});
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Configuration | Amplify UI for React
The Authenticator automatically infers loginMechanisms from amplify pull , but can be explicitly defined as seen below. By default, the Authenticator creates ...
Read more >8 New features in the Amplify Authenticator for web you ...
The new Authenticator allows you to add a login experience to your app with a single line of code. It addresses major customer...
Read more >How to use the @aws-amplify/auth.signOut function in ... - Snyk
Need to parse our local JWT as well to get cognito:groups attribute, because Auth.currentAuthenticatedUser() does not return user groups. return ...
Read more >The Complete Guide to Implement Social Login With AWS ...
Learn about how to set up a full-stack serverless ReactJS application using AWS Amplify with Google and Facebook Login functionality.
Read more >How to Setup Authentication Fast with AWS Amplify
Default configuration Warning: you will not be able to edit these selections. How do you want users to be able to sign in?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just updating – really the power of open-source! – 1: I did get the console.log to work – so this was a problem with my codes not calling into the right location. I now am getting the custom-attributes – 2: I still don’t have the global DEBUG reporting anything back, so I would be curious to understand what should be changed for that
summary: this can remain closed; with the newest Amplify the custom:attributes are readable
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.