amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
984 stars 454 forks source link

Can I use my own login page in sample web page demonstrates? #669

Open alpuriku opened 6 years ago

alpuriku commented 6 years ago

I know my question is a bit weird. In fact it is related to amazon-cognito-auth-js of AWS. https://github.com/aws/amazon-cognito-auth-js I have 2 domains, foo.com and bar.com.

I built my own login page with amazon-cognito-identity-js on domain foo.com, but I want the user from bar.com also authenticate through foo.com login page as well. Is it possible with amazon-cognito-identity-js provided functions?

In the sample demonstrates web page of amazon-cognito-auth-js, when I click the Sign in button, it redirects to the hosted ui login page by AWS to perform the login action and return to the callback url with #id_token. In the callback page, I think that it will perform the authentication by using auth.parseCognitoWebResponse(curUrl) with the #id_token provided in url.

I wonder if it is the appropriate way to perform multiple domain authentication or any other better solution.