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

Support OIDC RP-initiated logout #30072

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

jlehtoranta
Copy link

Add support for OIDC RP-initiated logout as defined in https://openid.net/specs/openid-connect-rpinitiated-1_0.html:

  • Track OIDC/OAuth2 login type, tokens and authentication data on session level
  • Keep session level data synced when using a login cookie (remember option)
  • Handle OIDC/OAuth2 logouts on an authentication source specific endpoint
  • Redirect to the OIDC end_session_endpoint, if it exists in the provider configuration
  • Fallback to local logout only
  • Be verbose about external logout errors
  • Use a callback endpoint for maintaining state between Gitea and an OIDC provider

Fixes #14270


Additional notes:

  • Tested with Keycloak (OIDC) and Github (OAuth2). Thorough testing with other IdPs and server setups is needed
  • There are most likely some (small) merge conflicts with Support SAML authentication #29403 as these PRs modify partly the same code
  • An additional PR is required for supporting OIDC back-channel (or front-channel) logout. I.e. your session in Gitea will still remain logged in, if you logout from your IdP elsewhere
  • Tracking external logins on session level by using ExternalAuthTokens makes it easier to implement OIDC back-channel or front-channel logout support in the future

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
…ions

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
…lumns

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
…ount

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 25, 2024
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 25, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/migrations labels Mar 25, 2024
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 10, 2024
@lunny
Copy link
Member

lunny commented Apr 10, 2024

Since it's a big change for the user system, I think we need more time to discuss and have a whole design about the user system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code modifies/migrations size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging out of OpenID Connect provider
3 participants