Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogoutToken Verify block multiple events messages #887

Open
regilero opened this issue Jan 21, 2025 · 0 comments
Open

LogoutToken Verify block multiple events messages #887

regilero opened this issue Jan 21, 2025 · 0 comments

Comments

@regilero
Copy link

Hello,

I'm using pyoidc with a BackChannellLogout endpoint, with a keycloak18 server as OP. It does work, but if I enable the "Backchannel Logout Revoke Offline Sessions" in Keycloak I get this sort of Logouttoken:

(...)
   'events': {
		'http://schemas.openid.net/event/backchannel-logout': {}, 
		'revoke_offline_access': True
	},
(...)

And this fails verification in oic/oic/message.py as currently the 'events' claim verification is very strict:

         # Check the 'events' JSON
         _keys = list(self["events"].keys())
         if len(_keys) != 1:
             raise ValueError('Must only be one member in "events"')
         if _keys[0] != BACK_CHANNEL_LOGOUT_EVENT:
             raise ValueError('Wrong member in "events"')
         if self["events"][_keys[0]] != {}:
             raise ValueError('Wrong member value in "events"')

Here we cannot have multiple events, and the 'http://schemas.openid.net/event/backchannel-logout':{} event must be the first one.

When checking the RFC at https://openid.net/specs/openid-connect-backchannel-1_0.html#LogoutToken I do not see the 1 event restriction but simply a required verification that this event is present in the list:

  1. Verify that the Logout Token contains an events Claim whose value is JSON object containing the member name http://schemas.openid.net/event/backchannel-logout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant