Skip to content

fix: Type back-channel logout tokens as logout+jwt - #140

Open
oleks9o6 wants to merge 4 commits into
RockSolidKnowledge:mainfrom
oleks9o6:fix/136-logout-token-typ
Open

oleks9o6 wants to merge 4 commits into
RockSolidKnowledge:mainfrom
oleks9o6:fix/136-logout-token-typ

Conversation

@oleks9o6

@oleks9o6 oleks9o6 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Back-channel logout tokens are now sent with typ: logout+jwt, as recommended by OpenID Connect Back-Channel Logout 1.0, section 2.4, instead of at+jwt.

Adds IdentityServerOptions.LogoutTokenJwtType (default logout+jwt; null or empty uses JWT), IdentityServerConstants.TokenTypes.LogoutToken and an IdentityServerTools.IssueJwtAsync overload that takes a token type. The names and default match Duende IdentityServer, so configuration carries over in either direction.

Closes #136

Type of change

  • Bug fix
  • Feature
  • Refactoring
  • Documentation
  • Other

Does this PR introduce a breaking change?

Does the change cause a breaking change to any of the following?

  • Changes to existing public APIs or DB schema
  • Changes which could cause existing behaviour to fail (eg. feature restrictions, changes to default values, stricter validation, etc)

The default logout token typ changes from at+jwt to logout+jwt. Per the research in #136, no common client library breaks. Setting LogoutTokenJwtType = "at+jwt" restores the old behaviour.

A subclass of IdentityServerTools that overrides IssueJwtAsync(lifetime, claims) no longer sees logout tokens; they go through the new overload, as in Duende 6.3.0.

Testing

New unit tests cover the logout typ, the option and its fallback, and that access tokens keep at+jwt. A new integration test checks the token posted to a client's back-channel logout URI. Without the new branch in DefaultTokenCreationService the logout typ tests fail, and without the empty-value check the fallback test fails. The full unit and integration suites pass.

LLM Usage

The src/ changes are written by me. The tests and the options.rst entry were drafted with Claude and reviewed by me.

Other context

Logout outside a request (#134) was fixed in #142. main is merged in here, so the logout token keeps the session's issuer from #142 and also gets the new type.

BackChannelLogoutHttpClient swallows exceptions, so assertions inside MockMessageHandler.OnInvoke can't fail a test. The new integration test asserts after the logout instead. The existing assertions in logout_should_invoke_back_channel_logout have the same problem.

🤖 Generated with Claude Code

oleks9o6 and others added 3 commits October 27, 2026 21:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oleks9o6
oleks9o6 marked this pull request as ready for review October 27, 2026 20:11
@patchandthat patchandthat added this to the 4.0 milestone Oct 28, 2026

@patchandthat patchandthat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks.

…n-typ

# Conflicts:
#	src/Open.IdentityServer/src/Services/Default/DefaultBackChannelLogoutService.cs

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Backchannel logout token type should be logout+jwt

2 participants