Commit Graph

204 Commits

Author SHA1 Message Date
Josh Cummings fed3de8dce Remove Logging of Untrusted Data 2023-08-08 10:02:42 -06:00
Josh Cummings 3307c656f4 Polish
- Added JavaDoc @since attribute
- Added Predicate based test
- Adjusted test names

Issue gh-13427
2023-08-08 10:02:42 -06:00
Baljit Singh e1bae73703 add factory methods for Jwt issuer resolvers
Closes gh-13427
2023-08-08 10:02:42 -06:00
Baljit Singh 7a713cab6f improve performance of Jwt issuer resolvers 2023-08-08 10:02:42 -06:00
Baljit Singh da35fa0485 make logging consistent for Jwt issuer resolvers 2023-08-08 10:02:42 -06:00
Baljit Singh af00be8a3d fix Javadocs for Jwt issuer resolvers 2023-08-08 10:02:42 -06:00
Josh Cummings 6c3636d780
Update Removed Usages
Issue gh-13544
2023-07-14 18:38:58 -06:00
Claudio Nave 52e12ad64b Replace deprecated methods 2023-06-22 13:19:55 -06:00
Krzysztof Krason 9b603b99ab Using modern Java features 2023-06-22 11:24:25 -06:00
Vedran Pavic 6f8ec3df60
Ensure access token isn't resolved from query for form-encoded requests
Closes gh-5668
2023-04-10 17:06:47 -06:00
Marcus Kainth f0ef54050e Add ability to set principalClaimName in ReactiveJwtAuthenticationConverter
Closes #12907
2023-03-27 16:43:30 -06:00
ch4mpy 7ad4ebd07a
Allow authentication details to be set by converter
Prevent JwtAuthenticationProvider from setting authentication details
when jwtAuthenticationConverter returned an authentication instance
with non null details.

Closes gh-11822
2022-12-12 18:55:08 -06:00
Josh Cummings cd0f02de49
Polish authorities claim delimiter
PR gh-12074
2022-12-02 14:30:31 -07:00
Patrick Walter 9c9fd9f4bd
Add configurable authorities split regex
Before this commit splitting the authorities claim was done by a
hardcoded regex " ". This commit allows to configure to set any regex
to split the authorities claim while keeping the previously
hardcoded regex as a default.

Closes gh-12074
2022-12-02 14:30:30 -07:00
Josh Cummings 5fe59cc635
Revert "Add configurable authorities split regex"
This reverts commit e93ed6d94c.

This can't be merged until after the 6.0 release
2022-11-01 17:39:26 -06:00
Patrick Walter e93ed6d94c Add configurable authorities split regex
Before this commit splitting the authorities claim was done by a
hardcoded regex " ". This commit allows to configure to set any regex
to split the authorities claim while keeping the previously
hardcoded regex as a default.
2022-11-01 17:38:47 -06:00
Josh Cummings f4cc27c375
Change Default for (Server)AuthenticationEntryPointFailureHandler
Closes gh-9429
2022-10-13 20:03:03 -06:00
Josh Cummings 5afc7cb04f
Merge remote-tracking branch 'origin/5.8.x' 2022-10-13 19:48:05 -06:00
Josh Cummings 099aaa33ff
Remove Deprecation Markers
Since Spring Security still needs these methods and classes, we
should wait on deprecating them if we can.

Instead, this commit changes the original classes to have a
boolean property that is currently false, but will switch to true
in 6.0.

At that time, BearerTokenAuthenticationFilter can change to use
the handler.

Closes gh-11932
2022-10-13 19:47:22 -06:00
Daniel Garnier-Moiroux 200b7fecd3
Add (Server)AuthenticationEntryPointFailureHandlerAdapter
Issue gh-11932, gh-9429

(Server)AuthenticationEntryPointFailureHandler should produce HTTP 500 instead
when an AuthenticationServiceException is thrown, instead of HTTP 401.
This commit deprecates the current behavior and introduces an opt-in
(Server)AuthenticationEntryPointFailureHandlerAdapter with the expected
behavior.

BearerTokenAuthenticationFilter uses the new adapter, but with a closure
to keep the current behavior re: entrypoint.
2022-10-13 19:25:04 -06:00
Josh Cummings 14584b0562
Add SecurityContextHolderStrategy to OAuth2
Issue gh-11060
2022-10-05 23:50:54 -06:00
Josh Cummings ae6fb8c681
Add Deprecated Versions of Original Classes
Issue gh-7349
2022-09-23 16:31:22 -06:00
Josh Cummings 37a160245f
Adjust OAuth2 Resource Server packaging
Closes gh-7349
2022-09-23 16:31:21 -06:00
Josh Cummings 53dbcfd457
Add Deprecated Versions of Original Classes
Issue gh-7349
2022-09-23 12:06:59 -06:00
Steve Riesenberg 3c66ef6305
Change default SecurityContextRepository
Save SecurityContext in request attributes for stateless session
management using RequestAttributeSecurityContextRepository.

Closes gh-11026
2022-09-22 17:31:14 -05:00
Josh Cummings 70460ca009
Adjust OAuth2 Resource Server packaging
Closes gh-7349
2022-09-20 17:44:05 -06:00
Steve Riesenberg 2431dd1103
Merge branch '5.8.x' 2022-09-13 17:38:10 -05:00
Steve Riesenberg 355ef21117
Polish gh-11665 2022-09-13 16:45:39 -05:00
ch4mpy 1efb63387f
Add authentication converter for introspected tokens
Adds configurable authentication converter for resource-servers with
token introspection (something very similar to what
JwtAuthenticationConverter does for resource-servers with JWT decoder).

The new (Reactive)OpaqueTokenAuthenticationConverter is given
responsibility for converting successful token introspection result
into an Authentication instance (which is currently done by a private
methods of OpaqueTokenAuthenticationProvider and
OpaqueTokenReactiveAuthenticationManager).

The default (Reactive)OpaqueTokenAuthenticationConverter, behave the
same as current private convert(OAuth2AuthenticatedPrincipal principal,
String token) methods: map authorities from scope attribute and build a
BearerTokenAuthentication.

Closes gh-11661
2022-09-13 16:45:36 -05:00
Joe Grandja 65db5fa028 Remove deprecations in JwtAuthenticationConverter
Closes gh-11587
2022-07-15 14:43:08 -04:00
Joe Grandja 7df9c6eba5 Use OAuth2Token instead of AbstractOAuth2Token
Closes gh-10959
2022-07-13 16:48:28 -04:00
Joe Grandja f87df42500 Remove deprecated OAuth2IntrospectionClaimAccessor
Closes gh-11499
2022-07-13 15:51:58 -04:00
Joe Grandja 7b18336c6a Change interface with constants to final class
Closes gh-10960
2022-07-13 15:51:58 -04:00
Josh Cummings 1d72a05c32
Add SecurityContextHolderStrategy to OAuth2
Issue gh-11060
2022-06-27 13:05:12 -06:00
Marcus Da Coregio 806e05855c Replace removed context-related operators
Closes gh-11194
2022-05-10 14:58:02 -03:00
Steve Riesenberg 8aa7029d07 Fix checkstyle errors
Issue gh-10989
2022-03-18 22:53:29 -05:00
Rob Winch 9b380582dc BearerTokenAuthenticationFilter.securityContextRepository
Issue gh-10953
2022-03-09 15:47:34 -06:00
Rob Winch 9db79aa5d7 BearerTokenAuthenticationFilter.securityContextRepository
Issue gh-10953
2022-03-09 15:33:42 -06:00
Rob Winch 8f64bb6c8c javax.servlet:javax.servlet-api -> jakarta.servlet:jakarta.servlet-api
Issue gh-10501
2022-01-19 14:33:53 -06:00
Josh Cummings 538541bf40 Don't Cache ReactiveJwtDecoders Errors
Closes gh-10444
2021-11-10 17:35:53 -07:00
Josh Cummings 2a6e00ceb0 Don't Cache ReactiveJwtDecoders Errors
Closes gh-10444
2021-11-10 17:33:03 -07:00
Marcus Da Coregio db60df2f9c Update to Spring Framework 6.0
Issue gh-10360
2021-11-01 09:02:42 -03:00
Rob Winch f836897190 Checkstyle Fixes
- Javadoc tag ordering
- Private constructors before inner classes

Issue gh-10394
2021-10-18 21:03:35 -05:00
Philipp Neuschwander 6db58cbf8a Conditionally resolve bearer token from request parameters
Before this commit, the DefaultBearerTokenResolver unconditionally
resolved the request parameters to check whether multiple tokens
are present in the request and reject those requests as invalid.

This commit changes this behaviour to resolve the request parameters
only if parameter token is supported for the specific request
according to spec (RFC 6750).

Closes gh-10326
2021-10-13 17:10:50 -05:00
Marcus Da Coregio 02b2fcc6f0 Restore ManagementConfigurationPlugin
Issue gh-9615
2021-10-05 11:23:29 -03:00
Marcus Da Coregio d2e5f2ae0d Update Gradle to 7.2
Closes gh-9615
2021-10-04 15:19:40 -03:00
Darren Forsythe 5556b821e3 Check for multiple access tokens per rfc 6750
Check for multiple access tokens on the ServerHttpRequest rather than get get first. If multiples are found throw a OAuth2AuthenticationException.

Closes gh-5708
2021-09-28 08:07:06 -06:00
Ashley Scopes 171522ebf2 Replace usages of deprecated OAuth2IntrospectionClaimNames
Replace all usages of OAuth2IntrospectionClaimNames with
the suggested OAuth2TokenIntrospectionClaimNames.

There does not appear to be any further usages of OAuth2IntrospectionClaimNames,
so it should be suitable for removal when appropriate in accordance with the
deprecation policy.
2021-09-15 15:05:08 -06:00
Ashley Scopes 7ccc915b2b Ensuring consistency in error handling of opaque providers/managers
The OpaqueTokenAuthenticationProvider now propagates the cause of
introspection exceptions in the same way that the reactive
OpaqueTokenReactiveAuthenticationManager does.

Fixed a final field warning on both OpaqueTokenAuthenticationProvider
and OpaqueTokenReactiveAuthenticationManager.
2021-09-15 15:05:08 -06:00
Ashley Scopes e9d5bbba34 Fixed final field warnings in opaque token introspectors 2021-09-15 15:05:08 -06:00