I'm trying to implement a single log out in my spring boot applications using keycloak and openid.
I already setup keycloak 3.4.3 with sprint boot 1.5.3 and spring security adapter (documentation here), algo using tomcat adapter (documentation here ). Everything works fine until I try to log out from all my sessions.
I have tried:
1) On keycloak administration console ui: logout all sessions result: it does clean all sessions from keycloak, but not the browser ones in my client applications. So I keep logged in until i delete them manually.
2) Using HttpServletRequest.logout() and http://auth-server/auth/realms/{realm-name}/protocol/openid-connect/logout?redirect_uri=encodedRedirectUri (documentation here), only logs out from the current client and not as a SLO
I'm not sure if OpenID supports SLO and I cannot find any reliable documentation about it.
¿Is there a way to implement Single log out using OpenID and Spring boot?
You can do the following to log out
@GetMapping(path = "/logout")
public String logout(HttpServletRequest request) throws ServletException {
request.logout();
return "/";
}
http
<a href="/logout">Logout</a>
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