Hi! I am authenticating users with AWS Identity Ce...
# ktor
a
Hi! I am authenticating users with AWS Identity Center SAML. When that login is successful, I am creating a Ktor Session for the user. That all works fine. Now I just added logout as well, by just adding a route that simply does this:
Copy code
get("/session/logout") {
    call.sessions.clear<Session>()
    call.respondRedirect("/")
}
Now I was very surprised that when I hit this route, I am not only logged out as it should be, but I am also redirected not to "/", but to the back to the AWS Identity Center. This is very cool, but I do wonder how this works. How does the browser know that it shall redirect to the identity center, as I never told it to ...?
Ah my bad, sorry. Mystery solved. Obviously when I log out, I hit the index route and that again checks for the login and if logged out, it redirects to identity provider.