Can I use amplify-js to check the token's validity.
I've been looking at cognito-express but could I use this library instead?
@dagda1 Amazon Cognito Federated Identities validates the token when you are invoking Auth.federatedSignIn on Amplify, then it returns credentials if token is valid or not.
thanks, but i am not using federated identities.
On Wed, 18 Jul 2018 at 22:59, elorzafe notifications@github.com wrote:
@dagda1 https://github.com/dagda1 Amazon Cognito Federated Identities
validates the token when you are invoking Auth.federatedSignIn on
Amplify, then it returns credentials if token is valid or not.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-js/issues/1265#issuecomment-406087415,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHOOOcyLzTVVJr4aEVGm8TQ5DlcC26Rks5uH6-lgaJpZM4VVTna
.
@dagda1 what do you mean by checking the token's validity?
@powerful23 yes, to decode the token and check the validity
Can you try
Auth.currentSession(session => {
const payload = session.getIdToken().decodePayload();
console.log('decode jwt token from cognito', payload);
})
Closing the issue. Feel free to reopen if you still have this issue.
Most helpful comment
Can you try