spring-projects / spring-projects/spring-security

Autoconfig bearer only clients OIDC

Open
#8,008 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: feedback-provided
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Summary

I'm trying to connect Keycloak and Spring Boot with Webflux (Kotlin) and I'm trying to pass Keycloak token as Bearer in Authorization header. Spring Boot App is set as Bearer only client.

Actual Behavior

Redirects me to root URL of Keycloak server

Expected Behavior

It would be good if Spring Security could detect Authorization header nad try to verify it without redirection to root URL

Configuration

Before I only used

  security:
    oauth2:
      client:
        registration:
          x-users:
            client-id: xxx
            client-secret: xxx
        provider:
          x-users:
            authorization-uri: https://xxx/auth/
            token-uri: https://xxx/auth/realms/test/protocol/openid-connect/token
            user-info-uri: https://xxx/auth/realms/test/protocol/openid-connect/userinfo
            user-name-attribute: sub
            jwk-set-uri: https://xxx/auth/realms/test/protocol/openid-connect/certs
            issuer-uri: https://xxx/auth/realms/test
Version

5.2.1 Release

Sample

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

The issue names no source file, test, or sample; start by reproducing the Spring Boot 5.2.1 WebFlux setup with a Bearer-only Keycloak client and inspect the OAuth2 entry points. Done means an Authorization bearer token is verified without redirecting to Keycloak, with regression coverage for that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, spring-boot
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.