amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
424 stars 232 forks source link

CognitoAuth.getCurrentUser returns undefined in the Implicit grant flow #98

Open watchwithdao opened 6 years ago

watchwithdao commented 6 years ago

I am integrating Amazon Cognito with a SAML identity provider which is also the sole identity provider of my app. I am using both Authorization code grant and Implicit grant flows. The allowed OAuth scopes are: aws.cognito.signin.user.admin, openid, profile, and email.

I am also retrieving the current user by calling the getCurrentUser method inside the onSuccess block of the userhandler property. While the getCurrentUser method returns the current username in the Authorization code grant flow, it returns undefined in the Implicit grant flow.

Is this a known issue?

yuntuowang commented 6 years ago

Hi @dnguyen219, we noticed this issue. I will push the fix very soon! Thanks!

yuntuowang commented 6 years ago

Hi @dnguyen219, we have published the fix. Please use v1.1.5 and try!