1495 Commits

Author SHA1 Message Date
Joe Grandja
db5310bee8
Enable null-safety in spring-security-oauth2-core
Closes gh-17820
2026-02-02 09:00:40 -06:00
Joe Grandja
fc5194d78b Merge branch '7.0.x' 2026-01-23 06:43:14 -05:00
Daniel Garnier-Moiroux
7cfcfaefae BearerTokenAuthenticationEntryPoint uses context path
Closes gh-18528

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
2026-01-23 06:27:26 -05:00
zoo-code
cd2be2fc1c Enable javadoc-warnings-error for oauth2-resource-server
Closes gh-18463

Signed-off-by: zoo-code <kyj20908@naver.com>
2026-01-21 15:49:55 -06:00
Robert Winch
48f958cbbf
Fix OAuth2AuthorizationRequestRedirectFilter constructor tests
OAuth2AuthorizationRequestRedirectFilterTests attempt to validate the constructors throw IllegalArgumentException if an invalid argument is provided, but
they are flawed because it is the relective code that is throwing the IllegalArgumentException due to imprecise type information.

This changes the tests to no longer use unnecessary reflection and casts the types so that the type information is used to target the correct
constructor.

Closes gh-18507
2026-01-16 10:34:10 -06:00
Bae Jihong
8692185de1 Fix javadoc warnings for spring-security-oauth2-client
- Fix a javadoc warning
- Apply javadoc-warnings-error plugin

Closes gh-18460

Signed-off-by: Bae Jihong <dasog@naver.com>
2026-01-13 10:01:13 -06:00
paulvas
da4362111a Fix: Enforce compiler warnings in oauth2-core
To prevent future compiler warnings from being introduced, this change
applies the `compile-warnings-error` plugin to the
`spring-security-oauth2-core` module.

This ensures that any new warnings will fail the build, maintaining
code quality and preventing warning accumulation.

Fixes: gh-18434
Signed-off-by: Pavel Vassiliev <paulvas@gmail.com>
Signed-off-by: paulvas <paulvas@gmail.com>
2026-01-12 13:57:57 -06:00
Pavel Vassiliev
1ddccd8a39 Fix spring-security-oauth2-core compiler warnings
Closes: gh-18434
Signed-off-by: Pavel Vassiliev <paulvas@gmail.com>

Signed-off-by: paulvas <paulvas@gmail.com>
2026-01-12 13:57:57 -06:00
Been24
beb3c78333 Replace method call with 'Builder.configureMessageConverters()'
Deprecated
since 7.0 in favor of configureMessageConverters(Consumer)

Closes gh-18378

Signed-off-by: Been24 <894661859qq@gmail.com>
2026-01-05 15:48:59 -05:00
Josh Cummings
964fcac086 Polish Tests
Issue gh-18269

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2025-12-15 09:43:07 -07:00
Ziqin Wang
1d1b3ff797 Fix "typ" header value in NimbusJwtEncoder-encoded JWT
Closes gh-18269

Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
2025-12-15 09:43:07 -07:00
Ziqin Wang
c8898f91fc Test NimbusJwtEncoder & NimbusJwtDecoder symmetrically
This test encodes an JWT with NimbusJwtEncoder, and then decodes it with
NimbusJwtDecoder.

This test will fail when NimbusJwtEncoder emits a JWT with a wrong `typ'
parameter in the header, as NimbusJwtDecoder validates the JWT with
JwtTypeValidator by default.  It may be beneficial for finding out other
similiar bugs too.

Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
2025-12-15 09:43:07 -07:00
Andrey Litvitski
0d5f42f852 Remove requireProofKey warning for non-auth-code flows
The warning is unnecessary since PKCE only applies to authorization_code
flow and the code already corrects this silently.

Closes: gh-18221

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-12-09 15:29:00 -05:00
Josh Cummings
4d9d40ead8 Update validateType JavaDoc
Closes gh-18227

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2025-12-09 09:07:30 -07:00
Joe Grandja
29b9dc6f04 Register runtime hints for authorization server
Issue gh-18251
2025-12-04 15:30:39 -05:00
Joe Grandja
c53e66a217 OAuth2AuthorizationEndpointFilter is applied after AuthorizationFilter
Closes gh-18251
2025-12-02 08:49:49 -05:00
Joe Grandja
5fb2875f47 AOT hints for authorization server Jackson 3 types should be registered
Closes gh-18146
2025-11-06 10:14:00 -05:00
Joe Grandja
27ae318992 JdbcRegisteredClientRepository should support Jackson 3
Issue gh-17832

Closes gh-18143
2025-11-05 15:27:14 -05:00
Joe Grandja
73840663b9 Polish JdbcOAuth2AuthorizationService 2025-11-05 06:41:41 -05:00
Joe Grandja
e6b4d461e7 Fix OAuth2AuthorizationServerJacksonModule type validator configuration
Closes gh-18102
2025-10-30 07:19:45 -04:00
Josh Cummings
4daf089e46 Merge remote-tracking branch 'origin/6.5.x' 2025-10-28 12:08:53 -06:00
namest504
6501e97ece Fix sensitive case in JwtTypeValidator
Closes gh-18092

Signed-off-by: namest504 <namest504@gmail.com>
2025-10-28 12:08:29 -06:00
Joe Grandja
90855aa128 Missing response_type in POST authorization request returns invalid_request
Issue https://github.com/spring-projects/spring-authorization-server/issues/2226
2025-10-24 05:55:45 -04:00
Joe Grandja
22cbb13f7d Add comments to SQL-scripts to ensure robust timezone handling
Issue https://github.com/spring-projects/spring-authorization-server/pull/2217
2025-10-20 07:12:50 -04:00
Joe Grandja
fc8b6b5863 Return PAR endpoint metadata only when enabled
Issue https://github.com/spring-projects/spring-authorization-server/issues/2219
2025-10-20 06:06:24 -04:00
Rob Winch
a181733365 Encapsulate GenericHttpMessageConverterAdapter
This will allow its removal in gh-18073
2025-10-19 17:03:19 -05:00
Rob Winch
5e851e0b26 Remove JdbcOAuth2AuthorizationService.Mapper
- We should not introduce an unnecessary public API
  - It would need to be removed when Jackson 2 support was removed, but
    was required to configure Jackson 3 support
  - There are already existing interfaces that could be used
- OAuth2AuthorizationRowMapper & OAuth2AuthorizationParametersMapper had
  unnecessary breaking changes by removing getter/setter for ObjectMapper
- To prevent NoClassDefFoundErrors all optional (Jackson) dependencies
  need to be on different classes & we wish to preserve the existing
  accessors for ObjectMapper which is this uses subclasses
- With added TestAuthenticationTokenMixin support, no need to explicitly
  add it in tests
2025-10-19 17:03:19 -05:00
Rob Winch
803936cfbe JacksonDelegate uses SecurityJacksonModules 2025-10-19 17:03:19 -05:00
Rob Winch
50568da1e5 Add Jackson 3 TestingAuthenticationToken Support
Without this many of the tests fail when using Jackson 3
2025-10-19 17:03:19 -05:00
Sébastien Deleuze
137f8fd670 Add support for JacksonJsonHttpMessageConverter
This commit introduces classpath checks and instantiation of
JacksonJsonHttpMessageConverter (based on Jackson 3) leveraging
a new GenericHttpMessageConverterAdapter which allows to adapt
SmartHttpMessageConverter to GenericHttpMessageConverter.

See gh-17832
Signed-off-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com>
2025-10-19 17:03:19 -05:00
Sébastien Deleuze
48854c3ac9 Deprecate Jackson 2 support
This commit does not cover webauthn which is a special case (uses
jackson sub-package for Jackson 2 support) which will be handled in
a distinct commit.

See gh-17832
Signed-off-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com>
2025-10-19 17:03:19 -05:00
Sébastien Deleuze
65a14d6c6d Add Jackson 3 support
This commit adds support for Jackson 3 which has the following
major differences with the Jackson 2 one:
 - jackson subpackage instead of jackson2
 - Jackson type prefix instead of Jackson2
 - JsonMapper instead of ObjectMapper
 - For configuration, JsonMapper.Builder instead of ObjectMapper
   since the latter is now immutable
 - Remove custom support for unmodifiable collections
 - Use safe default typing via a PolymorphicTypeValidator

Jackson 3 changes compared to Jackson 2 are documented in
https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a
and
https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md.

This commit does not cover webauthn which is a special case (uses
jackson sub-package for Jackson 2 support) which will be handled in
a distinct commit.

See gh-17832
Signed-off-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com>
2025-10-19 17:03:19 -05:00
Joe Grandja
fc795a81d4 PAR uses requested scopes on consent
Issue https://github.com/spring-projects/spring-authorization-server/pull/2182
2025-10-17 16:14:31 -04:00
Joe Grandja
4b810a8971 Disallow usage of the openid scope in device authorization requests
Issue https://github.com/spring-projects/spring-authorization-server/pull/2177
2025-10-17 11:41:30 -04:00
Joe Grandja
0d261e9c32 Remove setOidcUserMapper() in OidcUserService and OidcReactiveOAuth2UserService
Closes gh-18060
2025-10-16 16:29:52 -04:00
Josh Cummings
b1a50a25b6 Check If toBuilder Is Implemented
Since RC1 is right around the corner, let's change the API
footprint as little as possible by using reflection to check
if a class has declared toBuilder themselves. If they have, we
can assume that that class's builder will produce that class.

Issue gh-18052
2025-10-16 13:41:45 -06:00
Josh Cummings
4281f6b00b Prevent Duplicate Authorities
Issue gh-17981
2025-10-16 13:41:45 -06:00
Josh Cummings
0fcef6dca2 Add Missing Mock Configuration 2025-10-16 13:41:45 -06:00
Josh Cummings
2e7cdd7b14 Revert "Merge branch 'builder-enhancements'"
This reverts commit 95644fb73cd405ef4fd683e12773289343547fec, reversing
changes made to fbf7bb3be1eb7bff50cf311e8df7a869e7d9d21b.

Reverting this commit will allow us more time to
consider the ideal way to add this support to the public API.
2025-10-16 13:41:45 -06:00
Joe Grandja
af1de950ae Align setRetrieveUserInfo() between OidcUserService and OidcReactiveOAuth2UserService
Closes gh-18057
2025-10-16 15:12:10 -04:00
Joe Grandja
7f29585df4 Remove OidcUserService.setAccessibleScopes()
Closes gh-18056
2025-10-16 15:12:10 -04:00
Josh Cummings
4102007119 Add Builder#authentication
This commit consolidates logic common to applying one
authenticaiton to another. Specifically, it will copy the
authorities in one authentication into the builder instance
of another.

Closes gh-18053
2025-10-15 12:01:11 -06:00
Josh Cummings
e535e61c8b Move toBuilder to BuildableAuthentication
Closes gh-18052
2025-10-15 12:01:11 -06:00
Joe Grandja
fbf7bb3be1 Allow OAuth2AuthorizationRequest to be extended
Closes gh-18049
2025-10-14 16:34:59 -04:00
Ivan Golovko
979ac7c336 Remove cache from (Reactive)OidcIdTokenDecoderFactory
Closes gh-16647

Signed-off-by: iigolovko <iigolovko@ginc-it.ru>
2025-10-14 11:24:54 -04:00
Rob Winch
d18431a78d
Move FACTOR_ constants to FactorGrantedAuthority
Previously GrantedAuthorities had an implicit package tangle because it
was located in ~.core and FactorGrantedAuthority is in ~.core.authority
and FactorGrantedAuthority's authority property was implicitly expected
to be constants found in `GrantedAuthorities`.

This commit moves the constants to the FactorGrantedAuthority which
resolves this tangle. It wasn't initially done because
FactorGrantedAuthority did not exist at that time.

Closes gh-18030
2025-10-10 16:24:46 -05:00
Joe Grandja
586081c125 Revert "Temporarily fix integration tests"
This reverts commit 35f41f87d120efc70e0c764b42b6f6bae5c650e9.

Issue gh-17880
2025-10-10 13:33:42 -04:00
Joe Grandja
1213dbe76f Fix checkstyle 2025-10-09 13:51:50 -04:00
Joe Grandja
3656e7ad8c Add tests to OAuth2AuthorizationServerJackson2ModuleTests 2025-10-09 13:23:38 -04:00
Joe Grandja
1cca9c5822 Enable PKCE by default in authorization server
Closes gh-18020
2025-10-09 09:51:17 -04:00