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.

Amplify Authenticator not returning "attributes" on inital login

See original GitHub issue

Describe 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

  1. register to the authStateChange$-observable
  2. login via the authenticator
  3. 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) initiallogin

Browser refresh (secondary [automatic] login) secondarylogin

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:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
twoolfcommented, Mar 27, 2019

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

0reactions
github-actions[bot]commented, Jul 25, 2022

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

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 >

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