Skip to content

Gracefully handle disabled or removed IdP during logout#51163

Open
andrew2k4 wants to merge 1 commit into
keycloak:mainfrom
andrew2k4:fix/51123-idp-logout
Open

Gracefully handle disabled or removed IdP during logout#51163
andrew2k4 wants to merge 1 commit into
keycloak:mainfrom
andrew2k4:fix/51123-idp-logout

Conversation

@andrew2k4

Copy link
Copy Markdown

When a user logs in through an identity provider and that provider is later disabled or deleted, browserLogout throws an IdentityBrokerException that breaks the entire logout flow.

This wraps the identity provider lookup in a try-catch so that the logout completes locally even when the broker is no longer available, logging a warning instead of failing.

Closes #51123

Copilot AI review requested due to automatic review settings July 25, 2026 17:26
@andrew2k4
andrew2k4 requested review from a team as code owners July 25, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Allows local browser logout to complete when the originating identity provider is disabled or removed.

Changes:

  • Handles unavailable identity providers during browser logout.
  • Adds disabled and removed IdP logout tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
AuthenticationManager.java Skips unavailable broker logout and continues locally.
KcOidcBrokerLogoutTest.java Adds regression scenarios, but currently exercises backchannel logout.

Copilot AI review requested due to automatic review settings July 25, 2026 17:35
@andrew2k4
andrew2k4 force-pushed the fix/51123-idp-logout branch from b00051b to 7c292df Compare July 25, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java Outdated
Copilot AI review requested due to automatic review settings July 25, 2026 17:40
@andrew2k4
andrew2k4 force-pushed the fix/51123-idp-logout branch from 7c292df to 5d1d34d Compare July 25, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

When a user logs in through an identity provider and that provider is later disabled or deleted, browserLogout throws an IdentityBrokerException that breaks the entire logout flow.

This wraps the identity provider lookup in a try-catch so that the logout completes locally even when the broker is no longer available, logging a warning instead of failing.

Closes keycloak#51123

Signed-off-by: andrew <nguemnangandrew@gmail.com>
Copilot AI review requested due to automatic review settings July 25, 2026 17:45
@andrew2k4
andrew2k4 force-pushed the fix/51123-idp-logout branch from 5d1d34d to a2c6752 Compare July 25, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines +293 to +294
@Test
public void logoutSucceedsWhenIdpIsDisabled() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logout fails when IdP is disabled

2 participants