Cognito wants to implement the behavior of logging out and redirecting to the login screen with the authentication feature implemented on the application load balancer (hereafter ALB), but has a CORS error.
ALB distributes requests to EC2 instances.This time, we implemented authentication functionality in Cognito in ALB.If you access the instance without logging in, the login screen created by Cognito will be displayed, and if you enter your login information, the screen you want to display will be displayed.
Then, in order to implement the logout feature, we implemented the ability to respond to the deletion of session cookies stored in the browser and redirect response to logout endpoints in the server-side program.
After logging in, place the logout button and press the button to call the server-side program, log out, and display the login screen further.
I understand that fetch API sends request to Cognito logout endpoint.
Instead of sending the request via fetch API, try to redirect it by passing location.href() with the appropriate parameters.One of the parameters, redirect_uri, is the URL you want to view after logging out.
I want to log out and see more login screens
First of all, in order to understand how it works, redirect_uri should be checked to see if logout can be implemented by specifying the URL of the page that does not require authentication.Then, if you want the login screen to appear automatically, you can automatically redirect it to the URL of the app that needs authentication, and ALB will automatically redirect it to the Hosted UI of Cognito.
354 I have saved several codes written in python to a visual studio file.
367 To Limit Column Values to Strings in a String List Using sqlalchemy
356 I want to create an array of sequences from "1" to a specified number.
340 Scrap text information after the "View More" button when searching in the Yahoo! News search window
© 2023 OneMinuteCode. All rights reserved.