--
You received this message because you are subscribed to the Google Groups "Keycloak Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-dev/CAMvXD%3DFOZJxUZJNxPzkTXYfrs_JgbDRNVg3KfpeeRakoB_apwA%40mail.gmail.com.
I still would like to understand the reasons why the current implementation behaves as it does. Any pointers to discussions would be much appreciated. So far it seems to me that the inconsistency is should have never been there.
Ad spec - could you please point me where exactly the spec describes this behaviour? The only mention of offline tokens is in Section 2.7. Back-Channel Logout Actions, and as far as I read it, there is no mention that logout of an offline session should log out an online session as well. The only sentence touching a bit the topic there is "The RP then clears any state associated with the identified session(s)." However, it does not follow that the identified session of the offline session would also be the online session.
On Wed, Mar 31, 2021 at 8:25 AM Hynek Mlnarik <hmln...@redhat.com> wrote:I still would like to understand the reasons why the current implementation behaves as it does. Any pointers to discussions would be much appreciated. So far it seems to me that the inconsistency is should have never been there.I don't know all the motivation behind the current implementation. AFAIK, it has been there for a long time.The only inconsistency I can see is the fact that we are using logout to destroy offline sessions. And that is the reason why I mentioned the misconception around offline sessions.
That said, none of the options you gave to achieve consistency makes sense for me. The core issue (and a conceptual one, IMO) is offline sessions treated like online sessions a
nd their usage in the logout endpoint.
The fact we destroy online when "logging out" offline is our interpretation, probably motivated by some use case. And I don't see how to make that consistency without dropping offline sessions from the logout endpoint.
Ad spec - could you please point me where exactly the spec describes this behaviour? The only mention of offline tokens is in Section 2.7. Back-Channel Logout Actions, and as far as I read it, there is no mention that logout of an offline session should log out an online session as well. The only sentence touching a bit the topic there is "The RP then clears any state associated with the identified session(s)." However, it does not follow that the identified session of the offline session would also be the online session.Exactly that part. The point being, we do not destroy offline sessions when logging out online. And that is OK according to the specs. The handling of offline sessions is a question mark, and we decided for whatever reason to do it that way.
FYI, I also think both session types should be treated independently. But I'm not yet following why you are concerned about both sharing the same id if that will not really fix the "inconsistency".
Hi Hynek,
I think the spec does not even know about offline sessions. It only knows about sessions and offline tokens which might have been generated as part of a session. The differentiation between sessions and offline sessions is a Keycloak-specific
implementation choice. If the spec says, “RP then clears any state associated with the identified session”, that can only refer to the normal session. IMHO, the offline session is associated with the online session anyways, they even use the same session identifier.
So for me, it makes perfect sense to always logout normal sessions and optionally also remove offline sessions.
Best regards,
Sebastian
Mit freundlichen Grüßen / Best regards
Dr.-Ing.
Sebastian Schuster
Project Delivery Berlin 22 (IOC/PDL22)
Bosch.IO GmbH | Ullsteinstr. 128 | 12109 Berlin | GERMANY |
www.bosch.io
Tel. +49 30 726112-485 | Mobil +49 152 02177668 | Telefax +49 30 726112-100 |
Threema / Threema Work: MF9VMEAE |
Sebastian...@bosch.io
Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B
Aufsichtsratsvorsitzender: Dr.-Ing. Thorsten Lücke; Geschäftsführung: Dr. Stefan Ferber, Dr. Aleksandar Mitrovic, Yvonne Reckling
To view this discussion on the web visit
https://groups.google.com/d/msgid/keycloak-dev/CAMvXD%3DEQuedOBF70kCmpWkXgaS9C2UAhZ_489dMpmuqYeX4g9g%40mail.gmail.com.
Hi Hynek,
I think the spec does not even know about offline sessions. It only knows about sessions and offline tokens which might have been generated as part of a session. The differentiation between sessions and offline sessions is a Keycloak-specific
implementation choice.
If the spec says, “RP then clears any state associated with the identified session”, that can only refer to the normal session. IMHO, the offline session is associated with the online session anyways, they even use the same session identifier.
So for me, it makes perfect sense to always logout normal sessions and optionally also remove offline sessions.
Thanks Pedro.On Wed, Mar 31, 2021 at 3:30 PM Pedro Igor Craveiro e Silva <pigor.c...@gmail.com> wrote:On Wed, Mar 31, 2021 at 8:25 AM Hynek Mlnarik <hmln...@redhat.com> wrote:I still would like to understand the reasons why the current implementation behaves as it does. Any pointers to discussions would be much appreciated. So far it seems to me that the inconsistency is should have never been there.I don't know all the motivation behind the current implementation. AFAIK, it has been there for a long time.The only inconsistency I can see is the fact that we are using logout to destroy offline sessions. And that is the reason why I mentioned the misconception around offline sessions.That said, none of the options you gave to achieve consistency makes sense for me. The core issue (and a conceptual one, IMO) is offline sessions treated like online sessions and their usage in the logout endpoint.That's exactly the point - they are treated differently upon logout. The inconsistency is that offline session logout logs out also online session, while online session logout logs out only itself even if an offline session is there.
You raise an interesting point. Why should they be not treated in the same way? I take it is not per spec (though the logout endpoint is keycloak-specific either) but allowing revocation of offline tokens via logout endpoint does not seem to be a violation of the Logout Endpoint spec either?
The fact we destroy online when "logging out" offline is our interpretation, probably motivated by some use case. And I don't see how to make that consistency without dropping offline sessions from the logout endpoint.I am onboard with the idea with dropping offline sessions off the logout endpoint, if that is possible, and only revoking the offline sessions from the account / admin console.
Ad spec - could you please point me where exactly the spec describes this behaviour? The only mention of offline tokens is in Section 2.7. Back-Channel Logout Actions, and as far as I read it, there is no mention that logout of an offline session should log out an online session as well. The only sentence touching a bit the topic there is "The RP then clears any state associated with the identified session(s)." However, it does not follow that the identified session of the offline session would also be the online session.Exactly that part. The point being, we do not destroy offline sessions when logging out online. And that is OK according to the specs. The handling of offline sessions is a question mark, and we decided for whatever reason to do it that way.I am looking for exactly this reason :-)
FYI, I also think both session types should be treated independently. But I'm not yet following why you are concerned about both sharing the same id if that will not really fix the "inconsistency".I think we're on the same page here. My concern is not about sharing the same ID, this seems just to be a shortcut taken in the past. The question I am raising is about why do we maintain the connection between the online and offline session and whether this connection is even needed.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-dev/CAMvXD%3DFuDQHZJBYZfKPcMHwsqTXk4kxU2NdNDYrBCksw-tgUdg%40mail.gmail.com.
Hi Hynek,
I can at least give you some insight into our use case. We federate Keycloak with an external IDP. When the user changes its password there, the requirement is to log out the user everywhere, since the reason might be his password got compromised.
Since the external IDP does not know whether offline sessions are involved at Keycloak, he can only trigger one backchannel logout request. And this one should in effect basically invalidate everything in our case, sessions and offline tokens.
Best regards,
Sebastian
Mit freundlichen Grüßen / Best regards
Dr.-Ing.
Sebastian Schuster
Project Delivery Berlin 22 (IOC/PDL22)
Bosch.IO GmbH | Ullsteinstr. 128 | 12109 Berlin | GERMANY |
www.bosch.io
Tel. +49 30 726112-485 | Mobil +49 152 02177668 | Telefax +49 30 726112-100 |
Threema / Threema Work: MF9VMEAE |
Sebastian...@bosch.io
Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B
Aufsichtsratsvorsitzender: Dr.-Ing. Thorsten Lücke; Geschäftsführung: Dr. Stefan Ferber, Dr. Aleksandar Mitrovic, Yvonne Reckling
Hi Hynek,
I can at least give you some insight into our use case. We federate Keycloak with an external IDP. When the user changes its password there, the requirement is to log out the user everywhere, since the reason might be his password got compromised.
Since the external IDP does not know whether offline sessions are involved at Keycloak, he can only trigger one backchannel logout request. And this one should in effect basically invalidate everything in our case, sessions and offline tokens.
- The reason why during login there are both online and offline session is the SSO browser session. Due to this, every offline session is usually somehow tight to some "online" session, which was used for browser SSO login (with the exception of non-browser cases like OAuth2 Resource Owner Password Credentials Grant).
- I think there is some history for the current behaviour. When
we added initial support for offline tokens:
-- we did not yet have revocation endpoint as Pedro mentioned
-- there were not any OIDC logout specifications yet (even drafts)
-- we were focused a lot on our Keycloak adapters.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-dev/CAMvXD%3DFGv1uEwzkj94%2BwucX1k-NetjehHyopMvCNwkvTCNX7Eg%40mail.gmail.com.
+1 to everything you mentioned.
Marek