Amplify-js: Cognito IdToken with federated signIn (custom ui)

Created on 20 Aug 2019  路  8Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *
AWS Amplify, Auth, Social sign in

* What AWS Services are you utilizing? *
AWS Federated Login

* Provide additional details e.g. code snippets *
Our web-based application needs a social sign in with Amazon (federated signIn) and a "normal signIn" (cognito user pool).
We use a custom ui as a signIn page (not the provided hosted ui).
We would like to retrieve idToken from amplify and pass it to API Gateway for authentication and authorization logic (no problem with "normal signIn", we retrieve the token from currentUserSession)
How can we get the same result using federated signIn?

Auth OAuth pending-close-response-required question

All 8 comments

Hi @andreabarcaro thanks for your question. Cognito UserPool Tokens can be retrieved on the case you mention with other login providers (like Amazon) using Cognito Hosted UI.

For more information you can look here

Hi @elorzafe, thanks for the response. Is this feature scheduled at some point in your planning? It would be nice to do this via Amplify only.

Hi @elorzafe, I join this request. Often Hosted UI is too poorly customizable for enterprise purpose.

You do something like that: https://github.com/arelaxend/fays-openid
Still, it needs more than that to be fully secured.

@andreabarcaro @simone-zero12 you can customize your app bypassing Hosted UI, (pass thru_

Hi @elorzafe, I think I understood your comment... I used a version earlier than 1.1.25 so I couldn't get what I wanted. With latest version I can.
Thank you.

@andreabarcaro Did you see the comment from @elorzafe about using Hosted UI's functionality without actually displaying it's user interface? This will allow Amplify to automatically create entries in storage that will subsequently allow currentSession to work (wich should have the idtoken).

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shinnapatthesix picture shinnapatthesix  路  3Comments

ldgarcia picture ldgarcia  路  3Comments

guanzo picture guanzo  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

rygo6 picture rygo6  路  3Comments