Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use AWS Cognito as Single-sign-on?

I have 2 sites:

  • user registration, login and other stuff (will create users in cognito user pool)
  • user profile (self-care)

Both sites are in different domain. How can I implement SSO between both sites?

like image 547
Enson Avatar asked Jul 21 '17 02:07

Enson


People also ask

Can I use Cognito as an IdP?

IT pros typically use a third-party IdP for this function. However, a Cognito user pool is its own IdP. If an identity pool is configured correctly, it can use the app's user pools as an IdP. This way, users authenticate via user pools and are assigned IAM roles via identity pools.

Can Cognito be used as authorization?

Amazon Cognito enables simple, secure user authentication, authorization and user management for web and mobile apps. With Cognito, a user or visitor can sign in with a username and password through Amazon, or through a third party like Facebook, Google or Apple.


1 Answers

Yes you can do so in the following way

  • Login is done on the first site & you get a token
  • Use this token on 2nd site

The problem would be passing token(with an expiry value) from site A to B securely. There is no built in SSO facility provided by Cognito. You would have to manage the encrytion, storage & transfer of tokens yourself.

like image 97
agent420 Avatar answered Oct 13 '22 12:10

agent420