I'm using Amazon Cognito with the Built-In login page. I'd like to provide a link where I can customize my site after the user logs in based on where the user is coming from.
If I change the redirect_uri to a page that is different than configured in the App client settings I'll get a redirect_mismatch error.
If I add a query param it does not preserve it.
https://auth-local.auth.us-west-2.amazoncognito.com/login?response_type=code&client_id=<myid>&redirect_uri=http://localhost:4201/after-login&TEST_QUERY_PARM=1
Goes to:
http://localhost:4201/after-login?code=[code]
There is no TEST_QUERY_PARM that I set in the redirect_uri.
Is there any way I can track where it came from?
-
EDIT: I'm using AWS Chalice/Lambda for backend server
Did you try to configure two application clients each with its own callback URL. So to track calls from different sources you will do something like:
?response_type=code&client_id=<myid_1>&redirect_uri=<myurl_1>
?response_type=code&client_id=<myid_2>&redirect_uri=<myurl_2>
or you can actually configure several callback URLs for one App Client by separating them by a comma.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With