Commit Graph

601 Commits

Author SHA1 Message Date
Jan Oopkaup d31fff11b3
Add Post-Processor for JWTProcessor Configuration
Extends all existing builders in NimbusJwtDecoder and NimbusReactiveJwtDecoder with a
post-processor hook to apply changes on the JWTProcessor used for token verification.
Test cases added show how this is used to configure the JWTProcessor to allow additional
JWT typ headers.

Closes gh-8730
2020-06-26 07:52:16 -06:00
Joe Grandja 659b25a4e5 Fix typo in OAuth2AccessTokenResponse
Closes gh-8746
2020-06-22 08:21:59 -04:00
Rob Winch ca1252be94 Replace whitelist with allowlist
Issue gh-8676
2020-06-10 11:49:21 -05:00
Joe Grandja da4b626bf1 OAuth2LoginAuthenticationWebFilter should handle OAuth2AuthorizationException
Issue gh-8609
2020-06-09 17:28:21 -04:00
Joe Grandja 4c902bb857 OAuth2AuthorizationCodeGrantWebFilter should handle OAuth2AuthorizationException
Fixes gh-8609
2020-06-09 17:28:21 -04:00
Josh Cummings 1d821a2664
Add Ticket Number to Test
Issue gh-8650
2020-06-05 14:24:49 -06:00
Erik Bakker cd3fd6762f
Don't Consume Request Body
Per the servlet spec, getParameter(name) consumes the request body for
POST requests.

This commit prevents DefaultOAuth2AuthorizationRequestResolver from
consuming the request body for non-Authorization requests.

Closes gh-8650
2020-06-05 14:21:00 -06:00
Parikshit Dutta 28d2cfa14a Add ServerRequestCache setter in OAuth2AuthorizationCodeGrantWebFilter
Fixes gh-8536
2020-06-02 21:54:09 -04:00
Josh Cummings aa84c79e87
Use Nimbus Multiple Algorithm Support
Closes gh-8623
2020-06-02 12:49:21 -06:00
Parikshit Dutta 1e211b6558 Add RequestCache setter in OAuth2AuthorizationCodeGrantFilter
Fixes gh-8120
2020-05-15 15:13:15 -04:00
Joe Grandja c1abc9b134 Polish gh-8501 2020-05-15 13:26:09 -04:00
Thomas Vitale 78fa859798 Add issuerUri to ClientRegistration.providerDetails
- Add "issuerUri" attribute to ClientRegistration.providerDetails for OpenID Connect Discovery 1.0 or OAuth 2.0 Authorization Server Metadata.
- Validate OidcIdToken "iss" claim against the OpenID Provider "issuerUri" value.
- Update documentation for client registration: it includes issuer-uri property now.

Fixes gh-8326
2020-05-14 17:13:07 -04:00
Joe Grandja 86ca6b013c Unlock dependencies
This reverts commit 206960cf44.
2020-05-06 17:27:35 -04:00
Joe Grandja 206960cf44 Lock dependencies for 5.4.0-M1 2020-05-06 17:13:04 -04:00
Stav Shamir a783fbc641 Support update when saving with JdbcOAuth2AuthorizedClientService
Before this commit, JdbcOAuth2AuthorizedClientService threw DuplicateKeyException when re-authorizing or when authorizing the same user from a different client.

This commit makes JdbcOAuth2AuthorizedClientService's saveAuthorizedClient method consistent with that of InMemoryOAuth2AuthorizedClientService.

Fixes gh-8425
2020-04-29 07:37:57 -04:00
Julian Müller 60d4d5b7ee Enables empty authorityPrefix
- docs stated that empty authorityPrefix are allowed but implementation denied to use `""`
- commit removes the `hasText`-limitation but restricts to `notNull`

Fixes gh-8421
2020-04-22 08:52:54 -05:00
Daniel Furtlehner 32ce94d2dd Validate ID Token Issuer
When the issuer is set in the provider metadata, we validate the iss
field of the ID Token against it.

The OpenID Connect Specification says this must always be validated.
But this would be a breaking change for applications configured other
than with ClientRegistrations.fromOidcIssuerLocation(issuer). This will
be done later with #8326

Fixes gh-8321
2020-04-21 20:30:01 -04:00
Antonin Arquey 5cd1ec7bb3 Add AuthoritiesMapper setter for reactive OAuth2Login
Allow the configuration of a custom GrantedAuthorityMapper for reactive OAuth2Login

- Add setter in OidcAuthorizationCodeReactiveAuthenticationManager
  and OAuth2LoginReactiveAuthenticationManager

- Use an available GrantedAuthorityMapper bean to configure the default ReactiveAuthenticationManager

Fixes gh-8324
2020-04-17 16:55:05 -04:00
Evgeniy Cheban a70d55552b
Resource Server Finds JwtAuthenticationConverter Beans
Fixes gh-8185
2020-04-13 22:47:20 -06:00
Josh Cummings 10aa9743ed
Polish NimbusJwtDecoder
- Follow convention to prefix member variable references with "this."
- Reduce stack trace when IOException is thrown
- Name tests to follow conventions

Issue gh-8332
2020-04-10 16:45:01 -06:00
Mykyta Bezverkhyi 9133cc24e4
Add Cache to NimbusJwtDecoderJwkSetUriBuilder
PR gh-8332
2020-04-10 16:45:01 -06:00
Teddy Reinert 2f8eb16d76
Allow custom header during bearer token extraction
Added ability to specify the header that
ServerBearerTokenAuthenticationConverter and
DefaultBearerTokenResolver use to extract a Bearer Token.

Fixes gh-8337
2020-04-09 10:36:03 -06:00
Evgeniy Cheban 25fb1f417d Added setPrincipalClaimName to JwtAuthenticationConverter
Fixes gh-8186
2020-04-07 16:20:43 -06:00
Ruby Hartono 71b4248fe6 Improve OAuth2LoginAuthenticationProvider
1. update OAuth2LoginAuthenticationProvider to use
OAuth2AuthorizationCodeAuthenticationProvider
2. apply fix gh-5368 for OAuth2AuthorizationCodeAuthenticationProvider
to return additionalParameters value from accessTokenResponse

Fixes gh-5633
2020-03-30 20:55:43 -04:00
Martin Nemec 75c05d0bb4 OAuth2 ClientRegistrations NPE fix when userinfo missing
Fixes gh-8187
2020-03-27 05:58:28 -04:00
Joe Grandja 93ed92cc94 OAuth2ErrorHttpMessageConverter handles JSON object parameters
Fixes gh-8157
2020-03-24 14:51:04 -04:00
Joe Grandja 46baf38f59 Fix OAuth2AuthorizationRequest additionalParameters/attributes Consumer
Fixes gh-8177
2020-03-24 13:44:09 -04:00
Joe Grandja a9dabf6efb Assign sensible default for OAuth2AuthorizedClientProvider
Fixes gh-8150
2020-03-19 11:44:30 -04:00
Joe Grandja 26414ad3af Fix NPE when token response contains a null value
Fixes gh-8108
2020-03-16 15:56:59 -04:00
Josh Cummings 6eadf7b140
Unlock dependencies for 5.3.0.RELEASE
This reverts commit 147d7dadd7.
2020-03-04 12:02:48 -07:00
Josh Cummings 147d7dadd7
Lock dependencies for 5.3.0.RELEASE 2020-03-04 10:28:39 -07:00
Roman Matiushchenko 9d66f2ccce polish gh-7996
Make defensive collection copy as Collections.unmodifiableCollection
does not protect from the source collection direct modification.
Use Mono#map instead of Mono#flatMap as it allocates less.
Use less operators to reduce allocations.
Use lambda parameter instead of outer method parameter
in authenticationManagers#computeIfAbsent()
to make it non capturing so it could be cached by JVM.
Propagate cause for InvalidBearerTokenException.
2020-02-27 09:29:43 -07:00
Roman Matiushchenko 04e671fb4d Instantiate exceptions lazily
Add lazy Exception instantiation to reduce allocations

Fixes gh-7995
2020-02-27 09:29:43 -07:00
Josh Cummings 968ebb194b
baseUrl placeholder for OidcLogoutSuccessHandlers
Fixes gh-7842
2020-02-25 13:35:50 -07:00
Josh Cummings 283e451cad
Update JwtDecoders tests
Issue gh-7860
2020-02-25 13:33:20 -07:00
Zeeshan Adnan 431cd6000b
Add JwtClaimValidator
Fixes gh-7860
2020-02-25 13:32:41 -07:00
Joe Grandja fb2bbd74dc OAuth2AccessTokenResponseHttpMessageConverter handles JSON object parameters
Fixes gh-6463
2020-02-24 15:36:53 -05:00
Joe Grandja fa73b1397a Add missing @FunctionalInterface in oauth2 modules
Fixes gh-8020
2020-02-24 11:53:30 -05:00
Joe Grandja 3e5600f83f Add configurable Clock in OidcIdTokenValidator
Fixes gh-8019
2020-02-24 11:21:03 -05:00
Joe Grandja 7734d049eb Polish javadoc gh-7511 2020-02-24 10:35:58 -05:00
Joe Grandja d32c98b1c5 Add OAuth2AuthorizeRequest.Builder.principal(String)
Fixes gh-8018
2020-02-24 09:58:38 -05:00
Joe Grandja c6da7b2dd6 Polish gh-7840 2020-02-24 09:28:00 -05:00
Joe Grandja 65b5d468fb Deprecate UnAuthenticatedServerOAuth2AuthorizedClientRepository
Fixes gh-8016
2020-02-24 06:50:58 -05:00
Joe Grandja 4e2f1988f2 Polish Fix package tangles
Issue #7699 #7840
2020-02-24 06:42:00 -05:00
Joe Grandja 82cd203791 Remove unnecessary mocking
Fixes gh-8012
2020-02-23 19:35:16 -05:00
Joe Grandja 204a612be1 Deprecate Implicit Grant
Fixes gh-8013
2020-02-23 19:34:52 -05:00
Joe Grandja c8cc9717c9 Fix package tangles
Issue #7699 #7840
2020-02-23 07:24:36 -05:00
Joe Grandja f2da2c56be Resolve OAuth2Error from WWW-Authenticate header
Issue gh-7699
2020-02-21 15:12:58 -05:00
Joe Grandja 69156b741d Add OAuth2Authorization success/failure handlers
Fixes gh-7840
2020-02-21 15:12:58 -05:00
Joe Grandja 23ce717380 Simplify customizing OAuth2AuthorizationRequest
Fixes gh-7696
2020-02-19 06:22:07 -05:00