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

idToken is always empty #103

Closed raf202 closed 6 years ago

raf202 commented 6 years ago

I'm running the sample project with both token and code grant flows but after I call getSession(), even though the accessToken is always there and the refreshToken is there when using code grant, the idToken is always empty.

Is this the expected behavior? How can I get the idToken?

raf202 commented 6 years ago

Actually I found the answer in https://github.com/aws/amazon-cognito-auth-js/issues/45 - setting the scope to only email won't get idToken but setting to openID too gets an idToken.