spring-projects / spring-projects/spring-boot
Allow disabling OAuth2 / OIDC provider discovery explicitly
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
I think it would be useful to disable the OAuth2 / OIDC discovery explicitly. At this moment this is possible implicitly by configuring every necessary detail of the client's registration and provider but skipping the provider's issuerUri. This disables the discovery via OAuth2ClientPropertiesMapper.
Why
-
Someone wants the service to not require the IdP to be available at startup.
-
Some code may need the
issuerUrito function properly.In fact, there already is such code: Spring Securitys OIDC back channel logout validates the providers
issuerUriin OidcBackChannelLogoutTokenValidator and ends up with a NPE if you did not set anissuerUri.So setting the
issuerUrimeans you are forced to use discovery.
Leaving itnullmeans no working back channel logout, at least not with auto configuration.
How?
I'm not quite sure. Maybe a new property:
# default (fallback) value: true
spring.security.oauth2.client.provider.MY_PROVIDER.discovery=false
Setting this to false would opt-out the discovery. The current behaviour should be kept as default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OAuth2ClientPropertiesMapper.java, especially the provider registration mapping around the issuerUri handling, then review the referenced OidcBackChannelLogoutTokenValidator.java behavior. Determine how an explicit opt-out could coexist with the current default discovery behavior; done means discovery can be disabled without requiring the identity provider at startup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100