simplesamlphp / simplesamlphp/simplesamlphp-module-oidc

We always throw if `id_token_hint` is missing when `post_logout_redirect_uri` is used

Open
#321 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

prepared
Dominant language
PHP
Stars
50
Forks
28
Avg merge
1m
Merged PRs (30d)
2

Description

The spec RP-Initiated Logout https://openid.net/specs/openid-connect-rpinitiated-1_0.html says:

  1. Redirection to RP After Logout
    In some cases, the RP will request that the End-User's User Agent to be redirected back to the RP after a logout has been performed. Post-logout redirection is only done when the logout is RP-initiated, in which case the redirection target is the post_logout_redirect_uri parameter value sent by the initiating RP. An id_token_hint carring an ID Token for the RP is also RECOMMENDED when requesting post-logout redirection; if it is not supplied with post_logout_redirect_uri, the OP MUST NOT perform post-logout redirection unless the OP has other means of confirming the legitimacy of the post-logout redirection target. The OP also MUST NOT perform post-logout redirection if the post_logout_redirect_uri value supplied does not exactly match one of the previously registered post_logout_redirect_uris values. The post-logout redirection is performed after the OP has finished notifying the RPs that logged in with the OP for that End-User that they are to log out the End-User.

Currently we always throw, that is, stop the execution when id_token_hint is missing when post_logout_redirect_uri is used: https://github.com/simplesamlphp/simplesamlphp-module-oidc/blob/4c254afa8a80eb869351bc6dc161479f1f4d54a2/src/Server/RequestRules/Rules/PostLogoutRedirectUriRule.php#L59

Reading the spec, since id_token_hint is RECOMMENDED, we should not stop the execution, but simply not redirect to the post_logout_redirect_uri. We could show our own "you are logged out" page instead.

  • TODO mivanci check how conformance tests handle this situation

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Server/RequestRules/Rules/PostLogoutRedirectUriRule.php at the linked rule and read the RP-Initiated Logout specification section on post-logout redirection. Check how the conformance tests handle a missing id_token_hint, as noted in the TODO. Done means the request is not stopped solely for the missing hint and post-logout redirection is withheld unless the specification permits it.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.