405 Commits

Author SHA1 Message Date
Josh Cummings
59cdfc7d6e ReactiveJwtDecoder via OIDC Provider Configuration
A reactive static builder for constructing and configuring a
ReactiveJwtDecoder via an issuer that supports the OIDC Provider
Configuration spec.

Fixes: gh-5649
2018-08-21 15:09:18 -05:00
Josh Cummings
01443e35b4 Reactive Jwt Validation
This allows a user to customize the Jwt validation steps that
NimbusReactiveJwtDecoder will take for each Jwt.

Fixes: gh-5650
2018-08-21 15:06:05 -05:00
Josh Cummings
b11e9ed317
Fix Javadoc Typo
NimbusReactiveJwtDecoder incorrectly referred in its class-level doc
as being an implementation of JwtDecoder. This has been corrected to
say ReactiveJwtDecoder.

Fixes: gh-5711
2018-08-21 12:21:23 -06:00
Josh Cummings
3cd0ebedc9
Polish ClientRegistrations
Class is now final

Issue: gh-5647
2018-08-20 10:54:53 -06:00
Rob Winch
85d5d4083f Add ServerOAuth2AuthorizationRequestResolver
Fixes: gh-5610
2018-08-19 21:13:54 -05:00
Rob Winch
b9ab4929b7 Add OAuth2AuthorizationCodeGrantWebFilter
Issue: gh-5620
2018-08-19 21:12:41 -05:00
Rob Winch
d0ebe47cd5 OAuth2LoginReactiveAuthenticationManager uses OAuth2AuthorizationCodeReactiveAuthenticationManager
Issue: gh-5620
2018-08-19 21:12:32 -05:00
Rob Winch
8b67154e77 Add OAuth2AuthorizationCodeReactiveAuthenticationManager
Issue: gh-5620
2018-08-19 21:12:06 -05:00
Rob Winch
f843da1942 Add OAuth2LoginAuthenticationWebFilter
This is necessary so that the saving of the authorized client occurs
outside of the ReactiveAuthenticationManager. It will allow for
saving with the ServerWebExchange when ReactiveOAuth2AuthorizedClientRepository
is added.

Issue: gh-5621
2018-08-19 21:11:43 -05:00
Rob Winch
dd7925cb63 OAuth2AuthorizedClientArgumentResolver Uses ServerOAuth2AuthorizedClientRepository
Issue: gh-5621
2018-08-19 21:11:24 -05:00
Rob Winch
1d57a084aa Add ServerOAuth2AuthorizedClientRepository
Fixes: gh-5621
2018-08-19 21:10:15 -05:00
Rob Winch
3a7083c7e9 Add Test<DomainObject>s For OAuth2
Fixes: gh-5699
2018-08-19 21:08:28 -05:00
Rob Winch
b02ce59188 TestClientRegistrations
Fixes: gh-5651
2018-08-19 21:08:02 -05:00
Rob Winch
5ddb25fff8 Consistent .server package for ServerWebExchange OAuth2
Fixes: gh-5663
2018-08-19 21:05:55 -05:00
Rob Winch
e3eaa99ad0 Polish ServerAuthenticationConverter
Update changes for ServerAuthenticationConverter to be passive.

Issue: gh-5338
2018-08-18 19:55:39 -05:00
Eric Deandrea
b6afe66d32 Add ServerAuthenticationConverter interface
- Adding an ServerAuthenticationConverter interface
- Retro-fitting ServerOAuth2LoginAuthenticationTokenConverter,
 ServerBearerTokenAuthentivationConverter, ServerFormLoginAuthenticationConverter,
 and ServerHttpBasicAuthenticationConverter to implement ServerAuthenticationConverter
- Deprecate existing AuthenticationWebFilter.setAuthenticationConverter
and add overloaded one which takes ServerAuthenticationConverter

Fixes gh-5338
2018-08-18 19:55:39 -05:00
Josh Cummings
2e620a26de Auto-configure JwtDecoder via OpenId Configuration
Adding JwtDecoders#fromOidcIssuerLocation which takes an issuer
and derives from it the jwk set uri via a call to
.well-known/openid-configuration

Fixes: gh-5523
2018-08-17 11:20:26 -05:00
Josh Cummings
d610f31425 Jwt -> Authentication Conversion
Exposes ability to specify a strategy for converting Jwt into an
Authentication, specifically in JwtAuthenticationProvider.

Fixes: gh-5629
2018-08-17 11:04:27 -05:00
Rob Winch
938dbbf424 Add OAuth2AuthorizationRequestResolver.resolve(HttpServletRequest,String)
Previously there was a tangle between
DefaultOAuth2AuthorizationRequestResolver and
OAuth2AuthorizationRequestRedirectFilter with
AUTHORIZATION_REQUIRED_EXCEPTION_ATTR_NAME

This commit adds a new method that can be used for resolving the
OAuth2AuthorizationRequest when the client registration id is known.

Issue: gh-4911
2018-08-16 20:41:13 -05:00
Rob Winch
06df562d61 Polish JwtValidators
The current name of createDelegatingJwtValidator is not intuitive. The
name implies it is just creating a DelegatingOAuth2TokenValidator with
no mention that JwtTimestampValidator is being added.

To resolve this, the arguments have been removed and only
JwtTimestampValidator is added. User's needing additional validators can
add the result of this method to DelegatingOAuth2TokenValidator along with
the additional validators they wish to use. The method name has been
renamed to createDefault which now accurately reflects what is created.
There is no need to have JwtValidator at the end of the method since
the method is located in JwtValidators.

The commit also adds createDefaultWithIssuer for creating with a specific issuer.

Issue: gh-5133
2018-08-16 13:21:07 -05:00
Josh Cummings
7c524aa0c8 Jwt Claim Validation
This introduces OAuth2TokenValidator which allows the customization of
validation steps that need to be performing when decoding a string
token to a Jwt.

At this point, two validators, JwtTimestampValidator and
JwtIssuerValidator, are available for use.

Fixes: gh-5133
2018-08-16 13:19:26 -05:00
Josh Cummings
a4bd0d3923
OIDC Provider Configuration - ClientRegistrations
OIDC Provider Configuration is now being used to create more than just
ClientRegistration instances. Also, the endpoint is being addressed in
more contexts than just the client.

To that end, this refactors OidcConfigurationProvider in the config
project to ClientRegistrations in the oauth2-client project.

Fixes: gh-5647
2018-08-14 13:26:46 -06:00
Joe Grandja
cbdc7ee4b3 Relax validation on ClientRegistration
Fixes gh-5667
2018-08-14 14:05:45 -04:00
Joe Grandja
010d99a7d0 Make ClientRegistration.clientSecret optional
Fixes gh-5652
2018-08-14 13:32:51 -04:00
Joe Grandja
8a0c6868cd Add additional parameters to OAuth2UserRequest
Fixes gh-5368
2018-08-14 05:14:45 -04:00
Johnny Lim
68878a1675 Replace isEqualTo(null) with isNull() 2018-08-09 18:04:48 -06:00
Joe Grandja
16fe1c5b52 Expose RestOperations in NimbusJwtDecoderJwkSupport
Fixes gh-5603
2018-08-08 14:49:46 -04:00
Joe Grandja
11984039c2 Add OidcUserService.setOauth2UserService()
Fixes gh-5604
2018-08-08 09:32:47 -04:00
Joe Grandja
952743269d Add support for client_credentials grant
Fixes gh-4982
2018-08-08 08:06:47 -05:00
Johnny Lim
3d1185df3b Add @Deprecation on removeAuthorizationRequest() (#5634) 2018-08-03 09:37:48 -04:00
Rob Winch
1a65abd781 Add defaultOAuth2AuthorizedClient flag
Fixes: gh-5619
2018-07-31 14:44:40 -05:00
Rob Winch
2cd2bab818 Use HttpHeaders.setBasicAuth
Issue: gh-5612
2018-07-30 15:34:48 -05:00
Rob Winch
afa2d9cbc7 Remove ExchangeFilterFunctions
Issue: gh-5612
2018-07-30 15:34:44 -05:00
Rob Winch
262c1a77c6 Remove SecurityHeaders
We no longer need this since Spring Framework now provides
HttpHeaders.setBearerAuth

Issue: gh-5612
2018-07-30 15:34:40 -05:00
Joe Grandja
b5abb99908 ClaimAccessor.getClaimAsString() checks null claim value
Fixes gh-5608
2018-07-30 15:31:41 -04:00
Joe Grandja
e243f93eed Default to server_error when OAuth2Error.errorCode is null
Fixes gh-5594
2018-07-30 13:20:58 -04:00
Rob Winch
aea861e2f9 Fix Imports
Issue: gh-5599
2018-07-30 12:15:53 -05:00
Rob Winch
a01dc3a5f6 WebFlux Handles Undefined State Parameter
Currently if a state exists, but an undefined state parameter is provided
a NullPointerException occurs.

This commit handles the null value.

Fixes: gh-5599
2018-07-30 12:02:42 -05:00
Rob Winch
2056b3440f Add ServerBearerTokenAuthenticationConverter
Issue: gh-5605
2018-07-30 11:39:40 -05:00
Rob Winch
4f417f01a7 BearerTokenServerAuthenticationEntryPoint
Issue: gh-5605
2018-07-30 11:39:34 -05:00
Rob Winch
da73242d60 Add JwtReactiveAuthenticationManager
Issue: gh-5605
2018-07-30 11:39:28 -05:00
Rob Winch
b8308c9ae0 Extract JwtConverter
Issue: gh-5605
2018-07-30 11:37:56 -05:00
Rob Winch
f3c9cce56d Rename to WebClientAuthorizationCodeTokenResponseClient
Rename NimbusReactiveAUthorizationCodeTokenResponseClient to
WebClientReactiveAuthorizationCodeTokenResponseClient

Fixes: gh-5529
2018-07-26 15:14:11 -05:00
Rob Winch
1c8a931e33 Rename to OidcAuthorizationCodeReactiveAuthenticationManager
Renamed OidcReactiveAuthenticationManager to
OidcAuthorizationCodeReactiveAuthenticationManager since it only handles
authorization code flow.

Fixes: gh-5530
2018-07-26 15:14:11 -05:00
Joe Grandja
2c1c2c78c3 Add HttpServletResponse param to removeAuthorizationRequest
Fixes gh-5313
2018-07-26 14:15:56 -04:00
Johnny Lim
887db71333 Fix typo (#5580) 2018-07-26 10:04:21 -04:00
mhyeon.lee
ba29b363fc Fix OAuth2AuthorizationRequestRedirectWebFilter baseurl exclude querystring
To create redirect_uri in OAuth2AuthorizationRequestRedirectWebFilter,
queryParam is included in the current request-based baseUrl.
So when binding to the redirectUriTemplate,
the wrong type of redirect_uri may be created.

Fixed: gh-5520
2018-07-23 15:42:15 -04:00
Joe Grandja
36cbdfe013 Fix NPE when null Authentication in authorization_code grant
Fixes gh-5560
2018-07-23 12:28:48 -04:00
Rob Winch
88975dad41 ServletOAuth2AuthorizedClientExchangeFilterFunction handles null authorized client
Issue: gh-5545
2018-07-22 12:01:42 -07:00
Rob Winch
67dd3f16e9 Add static methods for ServletOAuth2AuthorizedClientExchangeFilterFunction
This will allow us to break up
ServletOAuth2AuthorizedClientExchangeFilterFunction into multiple
components if we decide to later.

Issue: gh-5545
2018-07-20 11:48:20 -05:00