[keycloak-user] Logout with openid-connect is not invalidating the session cookie.

Marek Posolda mposolda at redhat.com
Mon Sep 26 10:53:20 EDT 2016


It's strongly recommended to use our keycloak.js adapter. It doesn't use 
cookies to maintain state. See our examples for it in the example 
distribution.

If you handle things manually, you need to care about various things 
(like refreshes etc) and for logout, you of course need to care of 
manually removing all the OAuth related state from your application and 
possibly remove cookies (if your application is using them).

Marek


On 22/09/16 02:01, Sean Schade wrote:
> Do I need to use the Keycloak JS adapter in our Angular app in order 
> to get logout to work correctly? I thought we would be fine with just 
> the openid-connect logout url. It looks like the adapter clears the 
> token in the browser.
>
> https://github.com/keycloak/keycloak/tree/master/adapters/oidc/js/src/main/resources
>
>
> On Wed, Sep 21, 2016 at 2:08 PM, Sean Schade 
> <sean.schade at drillinginfo.com <mailto:sean.schade at drillinginfo.com>> 
> wrote:
>
>     Thanks Scott for replying. We don't use an adapter. We have an
>     Angular app that makes HTTP calls to backend services. All of our
>     services are behind a Keycloak Security Proxy.
>
>     We are migrating away from Oracle OAM to Keycloak, and with Oracle
>     navigating to the logout link was sufficient. I assumed the same
>     would be for Keycloak.
>
>     I initially thought this might be the bug:
>     https://issues.jboss.org/browse/KEYCLOAK-3311
>     <https://issues.jboss.org/browse/KEYCLOAK-3311>
>
>     However, after looking at the logs in Keycloak when I click the
>     Logout button in our app I see the following errors.
>
>     18:55:10,630WARN  [org.jboss.resteasy.resteasy_jaxrs.i18n]
>     (defaulttask-11) RESTEASY002130: Failedto parse request.:
>     javax.ws.rs.core.UriBuilderException: RESTEASY003330: Failedto
>     create URI: null
>
>      1. Causedby: javax.ws.rs.core.UriBuilderException:
>         RESTEASY003280: empty host name
>      2.         at
>         org.jboss.resteasy.specimpl.ResteasyUriBuilder.buildString(ResteasyUriBuilder.java:540)
>      3.         at
>         org.jboss.resteasy.specimpl.ResteasyUriBuilder.buildFromValues(ResteasyUriBuilder.java:743)
>
>
>     Perhaps it is a combination of the Keycloak Security Proxy and
>     some misconfiguration? I'm not really sure at this moment.
>
>     Is my assumption correct that we do not need an adapter for oidc
>     logout?
>
>
>     On Wed, Sep 21, 2016 at 1:29 PM, Scott Rossillo
>     <srossillo at smartling.com <mailto:srossillo at smartling.com>> wrote:
>
>         Which adapter are you using?
>
>         Scott Rossillo
>         Smartling | Senior Software Engineer
>         srossillo at smartling.com <mailto:srossillo at smartling.com>
>
>>         On Sep 21, 2016, at 2:03 PM, Sean Schade
>>         <sean.schade at drillinginfo.com
>>         <mailto:sean.schade at drillinginfo.com>> wrote:
>>
>>         We are having an issue where our browser application will
>>         initiate a logout, but after redirecting back to the
>>         application the user is not taken to the login screen. It
>>         appears the user is still logged in, and can fully access the
>>         application. I can see the session removed in Keycloak Admin
>>         UI. However, it appears the cookie never gets invalidated.
>>         Here is the redirect URL we use. Are we missing some
>>         configuration step in the client? I have standard flow,
>>         implicit flow, and direct access grants enabled. Valid
>>         redirect URIs, Base URL, and web origins are all configured
>>         in the client. Admin URL is not set as we are relying only on
>>         browser logout.
>>
>>         https://auth.dev.drillinginfo.com/auth/realms/dev/protocol/openid-connect/logout?redirect_uri=https%3A%2F%2Fapp.dev.drillinginfo.com/gallery/
>>         <https://auth.dev.drillinginfo.com/auth/realms/dev/protocol/openid-connect/logout?redirect_uri=https%3A%2F%2Fapp.dev.drillinginfo.com/gallery/>
>>         _______________________________________________ keycloak-user
>>         mailing list keycloak-user at lists.jboss.org
>>         <mailto:keycloak-user at lists.jboss.org>
>>         https://lists.jboss.org/mailman/listinfo/keycloak-user
>>         <https://lists.jboss.org/mailman/listinfo/keycloak-user>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160926/cacf8ad2/attachment.html 


More information about the keycloak-user mailing list