2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
You can use the state parameter to redirect users back to their original URL after authentication with Cognito-hosted UI:
- Store the original URL in the state parameter when starting authentication. URL-encode the original URL.
https://<your-domain>.auth.<region>.amazoncognito.com/login?response_type=code&client_id=<your_client_id>&redirect_uri=<your_redirect_uri>&state=<url_encoded_original_url>
-
In your callback handler, get the state parameter from the authentication response.
-
Redirect the user to the original URL obtained from the state parameter.
This way, you can redirect users to the correct URL with their specific query parameters after authentication.
관련 콘텐츠
- AWS 공식업데이트됨 7달 전
Ok - to be clear, I am using the hosted UI. I am not aware of there being a "callback handler". Are you just saying that my redirect uri should have something to handle the state? I am using API Gateway + Lambda to build a serverless app if that helps.