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

how do we redirect the page which is originally landed #89

Open saneera opened 6 years ago

saneera commented 6 years ago

Hi I need help for hosted page redirecting to originally landed page

what is the purpose of state parameter (its only for CSRF token or cognito use this one for internal checking ? ) can we use this our specific value for this ( because need to handle the page which is sent the request to cognito and handle the logic)

Thanks Saneera

gwander commented 6 years ago

Currently, cognito user pool doesn't not support that. You can config a list of frequent original URLs as allowed redirect URLs in your userpool, and assign the redirect URL to your original URL

dietergeerts commented 6 years ago

Is there a timeframe set when this feature will be included? Or even if this will be included in the near future?

craigatproperly commented 6 years ago

In my scenario I am using a standard redirect handler, but, before triggering the login set a "deep link redirect" value in browser storage. When the handler comes back it checks that value and redirects to the page.

So a single valid redirect location can turn into a variety of locations and the state parameter can stay in its use for matching requests and responses.

(It relies on trusting browser sandboxing and not having parallel logins in flight where the state can get crossed )