spring-projects / spring-projects/spring-security

Configurable JWS algorithm for decoding an OIDC back-channel logout token

Open
#19,704 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Expected Behavior

Analogous to

    @Bean
    public JwtDecoderFactory<ClientRegistration> idTokenDecoderFactory() {
        OidcIdTokenDecoderFactory idTokenDecoderFactory = new OidcIdTokenDecoderFactory();
        idTokenDecoderFactory.setJwsAlgorithmResolver(clientRegistration -> SignatureAlgorithm.<...>);
        return idTokenDecoderFactory;
    }

there should be a possibiliy to change the used JWS algorithm when decoding an OIDC back-channel logout token.

Current Behavior

If I'm not mistaken it's not easily possible to change the default algorithm JwsAlgorithms.RS256 in NimbusJwtDecoder (see org.springframework.security.config.annotation.web.configurers.oauth2.client.OidcBackChannelLogoutAuthenticationProvider#OidcBackChannelLogoutAuthenticationProvider).

Please let me know, if the algorithm can be set.

Context
The OIDC IdP (OpenID Connect Identity Provider) will not change the used JWS algorithm for the logout token.
Current workaround: the required classes from Spring Security were copied and modified. This is not a viable long-term solution (at least for me).

Thank you for your help!

Contributor guide

Open the contributing guide

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 at org.springframework.security.config.annotation.web.configurers.oauth2.client.OidcBackChannelLogoutAuthenticationProvider#OidcBackChannelLogoutAuthenticationProvider and inspect how NimbusJwtDecoder uses JwsAlgorithms.RS256. Compare this with OidcIdTokenDecoderFactory#setJwsAlgorithmResolver. Done means callers can configure the JWS algorithm used to decode an OIDC back-channel logout token without copying Spring Security classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, backend, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.