Commit Graph

3271 Commits

Author SHA1 Message Date
Joe Grandja e6b4d461e7 Fix OAuth2AuthorizationServerJacksonModule type validator configuration
CodeQL Advanced / codeql-analysis-call (push) Waiting to run Details
CI / Build (17, ubuntu-latest) (push) Waiting to run Details
CI / Build (17, windows-latest) (push) Waiting to run Details
CI / Deploy Artifacts (push) Blocked by required conditions Details
CI / Deploy Docs (push) Blocked by required conditions Details
CI / Deploy Schema (push) Blocked by required conditions Details
CI / Perform Release (push) Blocked by required conditions Details
CI / Send Notification (push) Blocked by required conditions Details
Deploy Docs / build (push) Waiting to run Details
Closes gh-18102
2025-10-30 07:19:45 -04:00
Josh Cummings 3a84894bf4 Revert "Add AuthorizationProxyMixin"
CodeQL Advanced / codeql-analysis-call (push) Waiting to run Details
CI / Build (17, ubuntu-latest) (push) Waiting to run Details
CI / Build (17, windows-latest) (push) Waiting to run Details
CI / Deploy Artifacts (push) Blocked by required conditions Details
CI / Deploy Docs (push) Blocked by required conditions Details
CI / Deploy Schema (push) Blocked by required conditions Details
CI / Perform Release (push) Blocked by required conditions Details
CI / Send Notification (push) Blocked by required conditions Details
Deploy Docs / build (push) Waiting to run Details
This reverts commit 743817fc15.
2025-10-27 17:30:44 -06:00
Josh Cummings 743817fc15 Add AuthorizationProxyMixin
This commit adds Jackson configuration specific to
authorization proxies created by Spring Security

Closes gh-18077
2025-10-20 17:16:21 -06:00
Josh Cummings 0a2f55d485 Clarify Nullability in Granted Authority Lambda
CodeQL Advanced / codeql-analysis-call (push) Waiting to run Details
CI / Build (17, ubuntu-latest) (push) Waiting to run Details
CI / Build (17, windows-latest) (push) Waiting to run Details
CI / Deploy Artifacts (push) Blocked by required conditions Details
CI / Deploy Docs (push) Blocked by required conditions Details
CI / Deploy Schema (push) Blocked by required conditions Details
CI / Perform Release (push) Blocked by required conditions Details
CI / Send Notification (push) Blocked by required conditions Details
Deploy Docs / build (push) Waiting to run Details
Issue gh-17999
2025-10-20 15:22:24 -06:00
Andrey Litvitski 9b61533db2 Mark `GrantedAuthority#getAuthority` as `@Nullable`
Closes: gh-17999

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-10-20 15:22:24 -06:00
Josh Cummings eb43830260 Polish JavaDoc
1. Removed comment about not changing field name in a
serialized object as this is true for all fields in a
Java-serialize POJO
2. Added example value for the constructor that demonstrates
the relationship between a role and an authority

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2025-10-20 15:18:11 -06:00
Yanming Zhou b55c28cf25 Polish SimpleGrantedAuthority
1. Add Javadoc to state that role is prefixed.
2. Rename constructor argument from `role` to `authority` for better readability.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-10-20 15:18:11 -06:00
Rob Winch 9dc27bee03 Link to gh-18077
CodeQL Advanced / codeql-analysis-call (push) Waiting to run Details
CI / Build (17, ubuntu-latest) (push) Waiting to run Details
CI / Build (17, windows-latest) (push) Waiting to run Details
CI / Deploy Artifacts (push) Blocked by required conditions Details
CI / Deploy Docs (push) Blocked by required conditions Details
CI / Deploy Schema (push) Blocked by required conditions Details
CI / Perform Release (push) Blocked by required conditions Details
CI / Send Notification (push) Blocked by required conditions Details
Deploy Docs / build (push) Waiting to run Details
2025-10-19 17:03:19 -05:00
Rob Winch d309f1887e Remove Extra Blank Line from CoreJacksonModule 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 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
Josh Cummings a435175723 Clean Up Generic Typing in Builder
Issue gh-17997
2025-10-17 11:13:00 -06: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 2e7cdd7b14 Revert "Merge branch 'builder-enhancements'"
This reverts commit 95644fb73c, reversing
changes made to fbf7bb3be1.

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
parthokr 938a5a7c77 Fix typo in AuthenticationProvider Javadoc
Signed-off-by: parthokr <partho.kr@proton.me>
2025-10-16 13:54:00 -05:00
Josh Cummings 21ff7688cc Move Builder to Authentication
Leaving the Builder in Authentication allows
authentication implementations to implement Builder
without needing to implement BuildableAuthentication.

Issue gh-18052
2025-10-15 12:01:11 -06: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
Rob Winch b864be92d8
Update to Reactor 2025.0.0-SNAPSHOT
To prepare for the release we should update to Reactor
2025.0.0-SNAPSHOT to fix any issues that are present.

Closes gh-18041
2025-10-13 11:16:27 -05:00
Rob Winch 2b4e36c67f
Add RequiredFactor.Builder.<factor-name>Authority()
Closes gh-18033
2025-10-10 16:24:47 -05:00
Rob Winch 702878acae
Create AuthorizationManagerFactories.multiFactor
Closes gh-18032
2025-10-10 16:24:47 -05:00
Rob Winch 488e55032e
AllFactorsAuthorizationManager->AllRequiredFactorsAuthorizationManager
This allows the authorization logic to be relaxed so that if RequiredFactor
only has an authority specified, then the GrantedAuthority can be of any
type.

Closes gh-18031
2025-10-10 16:24:47 -05: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
Rob Winch 473baad6bd
Add RequiredAuthoritiesRepository
Closes gh-18028
2025-10-10 15:42:17 -05:00
Rob Winch 864a9b2fb3
Fix ProviderManager.copyDetails Changes Authentication Type
Closes gh-18027
2025-10-10 11:03:49 -05:00
Rob Winch d1ff983c11
Add AllFactorsAuthorizationManager
Closes gh-17997
2025-10-03 15:20:03 -05:00
Rob Winch 3f74991ce9
Authentication adds FactorGrantedAuthority
Closes gh-18001
2025-10-03 15:20:03 -05:00
Rob Winch ce36fc1e76
Add FactorGrantedAuthority
Closes gh-17996
2025-10-03 15:20:00 -05:00
Rob Winch c9010345b9
Add TestingAuthenticationToken(principal,credential,grantedAuthorities...)
CodeQL Advanced / codeql-analysis-call (push) Waiting to run Details
CI / Build (17, ubuntu-latest) (push) Waiting to run Details
CI / Build (17, windows-latest) (push) Waiting to run Details
CI / Deploy Artifacts (push) Blocked by required conditions Details
CI / Deploy Docs (push) Blocked by required conditions Details
CI / Deploy Schema (push) Blocked by required conditions Details
CI / Perform Release (push) Blocked by required conditions Details
CI / Send Notification (push) Blocked by required conditions Details
Deploy Docs / build (push) Waiting to run Details
Closes gh-17980
2025-10-01 13:05:56 -05:00
Rob Winch 667cd4aa7c
Remove unnecessary throws Exception from spring-security-config
Closes gh-17957
2025-09-25 11:50:13 -05:00
Rob Winch b2d76dfe66
Add GrantedAuthorities.FACTOR_*_AUTHORITY
Closes gh-17952
2025-09-24 09:53:56 -05:00
Rob Winch 1608465a38
DefaultAuthorizationManagerFactory additionalAuthorization
This commit adds AuthorizationManager<T> additionalAuthorization to
DefaultAuthorizationManagerFactory which can be used for multi factor
authorization.

There is a builder that allows for creating an instance that requires
static additional authorities, but for more advanced cases users can
inject an additionalAuthorization that looks up if the user has settings
that enable additional required authorities.

The builder can later be updated to support checking that a particular
authority was granted within a specified amount of time.

Issue gh-17900
2025-09-23 15:25:26 -05:00
Andrey Litvitski 68742e170c Support Automatically Checking for Required Authorities in Authorization Rules
Closes: gh-17900

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-09-22 00:15:13 +03:00
Josh Cummings 765bdf1ed0
SpEL Expressions Support Returning AuthorizationManager
Closes gh-17936
2025-09-19 12:07:59 -06:00
Josh Cummings 6e7a181eac
Polish Authentication Factors
Issue gh-17933
2025-09-19 11:32:28 -06:00
Josh Cummings 758b35df9c
Add Factor Tests for Authentication Providers
Issue gh-17933
2025-09-19 11:32:27 -06:00
Josh Cummings 39e2bb67fc
Create Authentication Only Once
Issue gh-17933
2025-09-19 11:32:27 -06:00
Josh Cummings e8accd0499
Add Factory Authority When Authentication Succeeds
Issue gh-17933
2025-09-19 11:32:26 -06:00
Rob Winch 9eaadcc70d
Add hasAll(Roles|Authorities) to SecurityExpressionRoot
This adds support for hasAllRoles and hasAllAuthorities to method security
expressions.

Issue gh-17932
2025-09-19 09:33:50 -05:00
Rob Winch 675835e525
Add AuthorizationManagerFactory.hasAll(Authorities|Roles)
Closes gh-17932
2025-09-18 14:19:22 -05:00
Rob Winch bb6b8ae3f3
Add AllAuthoritiesReactiveAuthorizationManager
Issue gh-17916
2025-09-16 16:31:55 -05:00
Rob Winch 096dfd4046
Add AllAuthoritiesAuthorizationManager
Closes gh-17916
2025-09-16 15:48:27 -05:00
Josh Cummings f8272a8844
Fallback to Object When Determining Overridden Methods
Closes gh-17898
2025-09-15 09:16:50 -06:00
Josh Cummings eedcec9d5c
Move Core Access API
Issue gh-17847
2025-09-12 10:32:38 -06:00
Josh Cummings c66a028332 Polish Core Authentication Builders
Issue gh-17861
2025-09-09 14:59:14 -06:00
Josh Cummings dd50dc0c40 Remove Generic Typing From Authentication.Builder
It would be better to introduce parameter types for
principal and credentials into Authentication.Builder
at the same time as doing so for Authentication

Issue gh-17861
2025-09-09 14:49:13 -06:00
Josh Cummings 4744752a1b Add Internal Authentication Implementations
This commit allows a default implementation of
Authentication.Builder that performs the builder
operations. In this way, authorities and other previous
authentication material can still be effectively be
propagated in the event a custom authentication does
not implement the method.

Issue gh-17861
2025-09-09 14:49:13 -06:00
Josh Cummings 3f774548d2 Move Authority Propagation Into Filters
Given that the filters are the level at which the
SecurityContextHolder is consulted, this commit moves
the operation that ProviderManager was doing into each
authentication filter.

Issue gh-17862
2025-09-09 14:49:13 -06:00
Josh Cummings a0fe6a5fee Polish Builders
- Added remaining properties
- Removed apply method since Spring Security isn't using
it right now
- Made builders extensible since the authentications are
extensible

Issue gh-17861
2025-09-09 14:49:13 -06:00