Skip to content

Add AuthenticationConverter interface #5340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 226 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
0a6ccbc
Add AuthenticationConverter interface
edeandrea May 11, 2018
56d2551
Cleanup based on review comments
edeandrea Aug 17, 2018
58fa211
LoginPageGeneratingWebFilter conditionally renders formLogin
rwinch May 14, 2018
96eaaec
Single ClientRegistration redirects by default
rwinch May 14, 2018
ae6f324
Release 5.1.0.M1
rwinch May 15, 2018
41be145
Disable SNAPSHOT tests for release
rwinch May 15, 2018
2f9cd49
Next Development Version
rwinch May 15, 2018
d406a92
HttpConfigTests groovy->java
jzheaux May 15, 2018
1db0782
HttpCorsConfigTests groovy->java
jzheaux May 15, 2018
a759195
PlaceHolderAndELConfigTests groovy->java
jzheaux May 15, 2018
49f86bc
Update to spring-build-conventions:0.0.17.RELEASE
rwinch May 15, 2018
9791b8f
Add ClientRegistration from OpenID Connect Discovery
rwinch May 16, 2018
bb38e05
Update to Gradle 4.7
rwinch May 18, 2018
33310c6
Revert "Add ClientRegistration from OpenID Connect Discovery"
rwinch May 18, 2018
a1e4065
Revert "Revert "Add ClientRegistration from OpenID Connect Discovery""
rwinch May 18, 2018
f61c842
Move OidcConfigurationProvider to .oidc package
rwinch May 18, 2018
3cca5ad
Polish OidcConfigurationProvider Javadoc
rwinch May 18, 2018
5cafdbb
OidcConfigurationProvider uses OidcScopes.OPENID
rwinch May 18, 2018
b3f789e
Add OidcConfigurationProvider ClientAuthenticationMethod.POST support
rwinch May 18, 2018
e9eb7a2
OidcConfigurationProvider improve invalid issuer error
rwinch May 18, 2018
684688b
Exclude build from settings.gradle scanning
rwinch May 18, 2018
5a8129a
Polish settings.gradle
rwinch May 18, 2018
75dcd63
OidcConfigurationProvider validate returned issuer
rwinch May 18, 2018
a32d742
Polishing the OidcConfigurationProvider
kazuki43zoo May 19, 2018
0c653d6
Add Cross Site Tracing (XST) & HTTP Method Tampering Protection
rwinch May 24, 2018
2662f76
DelegatingServerLogoutHandler
edeandrea May 24, 2018
6d98e3c
Add DelegatingServerLogoutHandler(List<ServerLogoutHandler> delegates)
rwinch May 24, 2018
f2e9a5f
OAuth2AuthorizationRequestRedirectWebFilter handles ClientAuthorizati…
rwinch May 24, 2018
74d4280
Add OAuth2AuthorizedClientExchangeFilterFunction
rwinch May 25, 2018
986b109
Samples use OAuth2AuthorizedClientExchangeFilterFunction
rwinch May 25, 2018
e0d6c33
Update to Spring Boot 2.0.2.RELEASE
rwinch May 25, 2018
ee4b8cd
Add missing @Configuration for WebClientConfig
rwinch May 25, 2018
515159e
Add WebClient Bearer token support
rwinch May 25, 2018
945f6e4
DefaultLoginPageGeneratingFilter escapes OAuth2 ClientRegistrations
jgrandja May 29, 2018
52f95fa
Add OAuth2AuthenticationException constructor that takes only OAuth2E…
jgrandja May 30, 2018
3d69150
OAuth2ClientArgumentResolver uses AnnotatedElementUtils
jgrandja May 30, 2018
2a5ab9b
Simplify oauth2login sample
jgrandja May 30, 2018
333a221
Simplify oauth2login-webflux sample
jgrandja May 30, 2018
17302aa
Move oauth2login samples under oauth2 directory
jgrandja May 30, 2018
33badf6
SecurityContextHolderAwareRequestConfig groovy->java
jzheaux May 30, 2018
895821f
OidcUserService leverages DefaultOAuth2UserService
jgrandja May 31, 2018
578b863
Fix snapshot build
jgrandja Jun 1, 2018
8fa048b
Update WebFlux samples to use Spring Boot
rwinch Jun 5, 2018
c9b719e
Use Spring Framework 5.1.0 SNAPSHOT
rwinch Jun 4, 2018
35b0e28
Update to Gradle 4.8
rwinch Jun 5, 2018
20db00f
Remove Spring IO Tests
rwinch Jun 5, 2018
5c76a12
Move oauth2 samples under boot directory
jgrandja Jun 6, 2018
d29c979
Fix package tangle in OAuth2Configurer
jgrandja Jun 8, 2018
64ac24e
Rename @OAuth2Client to @RegisteredOAuth2AuthorizedClient
jgrandja Jun 8, 2018
ecea9dc
Add UserDetailsRepositoryReactiveAuthenticationManager.setScheduler
rwinch Jun 11, 2018
b288f9c
Add cross references to ReactorContextTestExecutionListener
rwinch Jun 11, 2018
cf6f31d
Associate Refresh Token to OAuth2AuthorizedClient
jgrandja Jun 11, 2018
e1a4a51
Update GAE to 1.9.64
rwinch Jun 12, 2018
94ad9a3
Update to Jackson 2.9.6
rwinch Jun 12, 2018
d8fa3c3
Update to nimbus-jose-jwt:5.11
rwinch Jun 12, 2018
3b83b6f
Update to oauth2-oidc-sdk:5.62
rwinch Jun 12, 2018
275f7e2
Update to unboundid-ldapsdk:4.0.6
rwinch Jun 12, 2018
62a48c9
Update to htmlunit:2.31
rwinch Jun 12, 2018
a142c78
Update to assertj-core:3.10.0
rwinch Jun 12, 2018
28adae9
Update to hsqldb:2.4.1
rwinch Jun 12, 2018
356c73c
Update to Hibernate 5.2.17
rwinch Jun 12, 2018
005b4af
Update to hibernate-validator:6.0.10.Final
rwinch Jun 12, 2018
777778b
Update to htmlunit-driver:2.31.0
rwinch Jun 12, 2018
6bcf96d
Update to Selenium 3.12.0
rwinch Jun 12, 2018
a86115f
Fix htmlunit
rwinch Jun 12, 2018
ffefd6d
Override toString() in all RequestMatcher
rwinch Jun 15, 2018
4f5924e
Polish OidcUserService
rwinch Jun 6, 2018
979d65c
Add DelegatingReactiveAuthenticationManager
rwinch Jun 6, 2018
9adae4d
Extract OidcUserRequestUtils
rwinch May 25, 2018
7c37371
Extract OidcTokenValidator
rwinch May 25, 2018
278e595
Add JWKSelectorFactory
rwinch Jun 14, 2018
8ab8912
Add JWKContext
rwinch Jun 14, 2018
453d9e0
Add JWKContextJWKSource
rwinch Jun 14, 2018
f3d860f
Add ReactiveRemoteJWKSource
rwinch Jun 14, 2018
a3920ef
Add NimbusReactiveJwtDecoder
rwinch Jun 13, 2018
565acfe
Add OidcReactiveOAuth2UserService
rwinch Jun 6, 2018
95c8702
Add OidcReactiveAuthenticationManager
rwinch May 25, 2018
bf9c5bb
ServerHttpSecurity oauth leverages OidcReactiveAuthenticationManager
rwinch Jun 6, 2018
886d614
Polish OAuth2Configurer
jgrandja Jun 18, 2018
a34195c
HttpHeadersConfigTests groovy->java
jzheaux Jun 20, 2018
027dea2
Update to Spring Boot 2.0.3.RELEASE
rwinch Jun 20, 2018
5e2a37e
adding a test
rwinch Jun 25, 2018
79739db
Fixes in decoder
rwinch Jun 25, 2018
91547d2
Add NimbusJwkReactiveJwtDecoderTests
rwinch Jun 25, 2018
dd93d79
OAuth2ClientWebMvcSecurityConfiguration handles multiple OAuth2Author…
jgrandja Jun 25, 2018
a1f8691
Improve message for NoUniqueBeanDefinitionException in OAuth2ClientCo…
jgrandja Jun 25, 2018
097b04d
Validate sub claim in UserInfo Response
jgrandja Jun 25, 2018
8152fe3
Add NimbusReactiveJwtDecoder RSAPublicKey Support
rwinch Jun 26, 2018
7dd721e
Rename createJwkSet method typo
jzheaux Jun 28, 2018
6f1d1a2
InterceptUrlConfigTests groovy->java
jzheaux Jul 2, 2018
2bdd799
Add OAuth2AccessTokenResponse.withResponse
rwinch Jun 28, 2018
a0fea11
Add OAuth2AccessTokenResponseBodyExtractor
rwinch Jun 28, 2018
5651970
MockExchangeFunction Support Multiple Requests
rwinch Jul 2, 2018
144d61d
Add MockExchangeFunction getResponse
rwinch Jul 2, 2018
1cc5eed
OAuth2AuthorizedClientExchangeFilterFunction Refresh Support
rwinch Jul 2, 2018
ea18dc4
Fix Imports of OAuth2AccessTokenResponse
rwinch Jul 2, 2018
fa8c118
Fix checkstyle OAuth2AuthorizedClientExchangeFilterFunctionTests
rwinch Jul 2, 2018
6373b59
Fix OAuth2AuthorizedClientExchangeFilterFunctionTests on JDK9
rwinch Jul 2, 2018
8bb5e6f
Fix OAuth2BodyExtractorsTests for JDK9
rwinch Jul 2, 2018
4897252
Close Nimbus Information Leak
jzheaux Jun 25, 2018
95b29e9
HstsSpec methods return this
mahanhz Jul 4, 2018
4c4f95a
NimbusReactiveJwtDecoder propagates errors looking up keys
rwinch Jul 6, 2018
cb50da4
Polish Javadoc in ServerHttpSecurity
izeye Jul 11, 2018
87dd02e
Fix oauth2login loginProcessingUrl NPE for java config
Jul 6, 2018
1a0866b
Enhance OAuth2AccessToken to be serializable
Jul 10, 2018
e852c2a
Add JdbcUserDetailsManager(DataSource) constructor
rwinch Jul 13, 2018
5e96544
Jenkinsfile add --refresh-dependencies JDK specific builds
rwinch Jul 14, 2018
8e81fcd
Spring Version null for NullPointerException
rwinch Jul 15, 2018
bd7cd72
Add scripts/s101.sh
rwinch Jul 14, 2018
bae1436
Add PasswordEncoder.upgradeEncoding
rwinch Jul 14, 2018
66145c0
UserDetailsPasswordService
rwinch Jul 14, 2018
2099b97
DaoAuthenticationProvider supports password upgrades
rwinch Jul 14, 2018
fece4be
Configuration Support for UserDetailsPasswordManager
rwinch Jul 15, 2018
d201959
ReactiveUserDetailsPasswordService
rwinch Jul 15, 2018
dcfae12
UserDetailsRepositoryReactiveAuthenticationManager uses ReactiveUserD…
rwinch Jul 15, 2018
89a911a
Configuration for ReactiveUserDetailsPasswordService
rwinch Jul 15, 2018
783ef53
Modernize Default Log In Page
rwinch Jul 9, 2018
3ab5b30
Default Log Out Page
rwinch Jul 13, 2018
5b0f37f
Add support for custom authorization request parameters
jgrandja Jul 1, 2018
75362c6
Support anonymous Principal for OAuth2AuthorizedClient
jgrandja Jun 27, 2018
b1d3e3b
Transient Authentication Tokens
jzheaux Jun 12, 2018
64cdb48
Improved Session Creation Policy Configuration
jzheaux Jun 25, 2018
432f4f0
Disable CSRF by Request Matcher
jzheaux May 30, 2018
073d9e5
Access Denied Handling Defaults
jzheaux Jun 12, 2018
7f7a4b2
Remap Nimbus JSON Parsing Errors
jzheaux Jun 29, 2018
304f32e
Resource Server Jwt Support
jzheaux Jun 13, 2018
02b1c35
Rename @TransientAuthentication to @Transient
rwinch Jul 16, 2018
eceae15
Rename @TransientAuthentication to @Transient
rwinch Jul 16, 2018
07c4d92
Reliable Error State Tests
jzheaux Jul 16, 2018
d002814
Reliable Error State Tests - Nimbus
jzheaux Jul 16, 2018
3687098
Allow configuring a custom OAuth2AuthorizationRequestResolver
jgrandja Jul 16, 2018
27e4751
Add ClientRegistration.Builder.registrationId
rwinch Jul 17, 2018
a294ae3
Add Bearer Token filter to Security Filters
jzheaux Jul 16, 2018
695f3f7
Fix DefaultOAuth2AuthorizationRequestResolver baseUrl excludes queryP…
Jul 16, 2018
ba745eb
SessionManagementConfigTests groovy->java
jzheaux Jul 13, 2018
2ecfa67
Cache Control disabled for 304
rwinch Jul 18, 2018
826e298
Polish Javadoc to remove warning
Jul 12, 2018
94e7bbc
Fix OAuth2 ClientRegistration scope can be null
Jul 10, 2018
a635330
Include email in user information attributes from Facebook
Jul 17, 2018
5f2b0fa
Default Log In Pages Use HTTPS for CSS
rwinch Jul 19, 2018
56b0f64
Fix a missing "throws Exception" for configure(AuthenticationManagerB…
ehudon Jul 18, 2018
2e8b371
Fixed document error
henryqhl Jun 14, 2018
aae7c2a
MultiHttpBlockConfigTests groovy->java
jzheaux Jul 19, 2018
d7f58d0
Use OAuth2AuthorizedClientRepository in filters and resolver
jgrandja Jul 19, 2018
71fde4f
Use context.getBean() for ClientRegistrationRepository
jgrandja Jul 20, 2018
827109c
Add AuthenticationMethod type
Jul 11, 2018
8758abb
User-Specified JwtDecoder
jzheaux Jul 16, 2018
21c33ed
Add ServletOAuth2AuthorizedClientExchangeFilterFunction
rwinch Jul 20, 2018
dc68483
Rename to ServerOAuth2AuthorizedClientExchangeFilterFunction
rwinch Jul 20, 2018
329706e
Add static methods for ServletOAuth2AuthorizedClientExchangeFilterFun…
rwinch Jul 20, 2018
cc63d87
ServletOAuth2AuthorizedClientExchangeFilterFunction handles null auth…
rwinch Jul 22, 2018
cf6ee79
Auto-redirect to provider login when one client configured
jgrandja Jul 22, 2018
9a3307d
Fix NPE when null Authentication in authorization_code grant
jgrandja Jul 23, 2018
f6a9ce7
OpenIDConfigTests groovy->java
jzheaux Jul 20, 2018
df73a43
Fix OAuth2AuthorizationRequestRedirectWebFilter baseurl exclude query…
Jul 23, 2018
2274143
Bearer Token Resolver Configuration
jzheaux Jul 20, 2018
96e0d0d
Bearer Token Exception Handling Configuration
jzheaux Jul 17, 2018
165537b
Update to cglib-nodep:3.2.7
jgrandja Jul 24, 2018
cd632f5
Update to nimbus-jose-jwt:5.14
jgrandja Jul 24, 2018
9298be0
Update to oauth2-oidc-sdk:5.64.2
jgrandja Jul 24, 2018
80f121b
Update to javax.servlet.jsp.jstl-api:1.2.2
jgrandja Jul 24, 2018
4276996
Update to ehcache:2.10.5
jgrandja Jul 24, 2018
c79ce70
Update to org.apache.httpcomponents:httpclient:4.5.6
jgrandja Jul 24, 2018
e8a29e9
Update to bcpkix-jdk15on:1.60
jgrandja Jul 24, 2018
e65b6c8
Update to hibernate-entitymanager:5.3.3.Final
jgrandja Jul 24, 2018
9ece445
Update to hibernate-validator:6.0.11.Final
jgrandja Jul 24, 2018
47c9949
Update to selenium-java:3.13.0
jgrandja Jul 24, 2018
33b0af4
Update to selenium-support:3.13.0
jgrandja Jul 24, 2018
9fa1529
Fix typo (#5580)
izeye Jul 26, 2018
1fd7c39
Add HttpServletResponse param to removeAuthorizationRequest
jgrandja Jul 24, 2018
f8fbe16
Add SimpleSavedRequest
rwinch Jul 26, 2018
64893f0
Rename FormLoginConfigurerTests to FormLoginConfigurerSpec
rwinch Jul 26, 2018
5ada70f
Simplify Configuring RequestCache
rwinch Jul 26, 2018
b7f4e73
Default RequestCache as @Bean
rwinch Jul 26, 2018
626c5d9
HttpSessionRequestCache Allow Any SavedRequest
rwinch Jul 26, 2018
9707f65
Update to Reactor Californium M1
rwinch Jul 26, 2018
d716ef6
Update to Spring Framework 5.1.0.RC1
rwinch Jul 26, 2018
6459768
Update to Spring Data Lovelace RC1
rwinch Jul 26, 2018
2034b97
Rename to OidcAuthorizationCodeReactiveAuthenticationManager
rwinch Jul 26, 2018
1d3acc0
Rename to WebClientAuthorizationCodeTokenResponseClient
rwinch Jul 26, 2018
53c5915
Release 5.1.0.M2
rwinch Jul 26, 2018
bfeab92
Next Development Version
rwinch Jul 26, 2018
1393699
Disable Snapshot for release
rwinch Jul 27, 2018
d36182a
Release 5.1.0.M2
rwinch Jul 26, 2018
eab6753
Next Development Version
rwinch Jul 27, 2018
f24a368
Extract JwtConverter
rwinch Jul 5, 2018
2905b90
Add JwtReactiveAuthenticationManager
rwinch Jul 6, 2018
590d72d
BearerTokenServerAuthenticationEntryPoint
rwinch Jul 6, 2018
edca9f3
Add ServerBearerTokenAuthenticationConverter
rwinch Jul 6, 2018
79f49db
Add OAuth2Spec
rwinch Jul 6, 2018
a4d1f3b
Add Sample
rwinch Jul 6, 2018
2d76270
WebFlux Handles Undefined State Parameter
rwinch Jul 30, 2018
03a4117
Add OAuth2LoginSpec.and()
rwinch Jul 30, 2018
cd1657b
Fix Imports
rwinch Jul 30, 2018
c67e2a1
Default to server_error when OAuth2Error.errorCode is null
jgrandja Jul 30, 2018
eb6ebd3
ClaimAccessor.getClaimAsString() checks null claim value
jgrandja Jul 30, 2018
c9af1c1
Update to Spring Boot 2.1.0.M1
rwinch Jul 30, 2018
04a0610
Remove SecurityHeaders
rwinch Jul 30, 2018
c3c196f
Remove ExchangeFilterFunctions
rwinch Jul 30, 2018
3383ae5
Use HttpHeaders.setBasicAuth
rwinch Jul 30, 2018
4f0ce5a
BasicAuthenticationFilter case insenstive
rwinch Jul 31, 2018
905427d
ServerHttpBasicAuthenticationConverter Validates Scheme Name
rwinch Jul 31, 2018
ca010db
Mention spring-security-data dependency for Spring Data in doc
izeye Jul 31, 2018
6646073
Add CORS WebFlux Support
rwinch Jul 31, 2018
9f1a299
Add defaultOAuth2AuthorizedClient flag
rwinch Jul 31, 2018
47c935f
Add @Deprecation on removeAuthorizationRequest() (#5634)
izeye Aug 3, 2018
dd1bd43
Add @Configuration to ServerHttpSecurityConfiguration
rwinch Aug 3, 2018
d09c244
Fix typo
izeye Aug 2, 2018
9395983
Regenerate spring-security-5.1.xsd
rwinch Aug 3, 2018
df387c8
Fix typo
izeye Aug 8, 2018
db36784
Made JwtConfigurer fluent
Aug 7, 2018
82f0767
Add support for client_credentials grant
jgrandja Jul 18, 2018
0f090b2
Add OidcUserService.setOauth2UserService()
jgrandja Aug 8, 2018
47a8edc
Expose RestOperations in NimbusJwtDecoderJwkSupport
jgrandja Aug 8, 2018
c635492
Move OAuth2ClientConfigurer.configure to AuthorizationCodeGrantConfig…
rwinch Aug 8, 2018
d464d2b
Create AuthorizationEndpointConfig.configure
rwinch Aug 8, 2018
e85e307
Replace isEqualTo(null) with isNull()
izeye Aug 6, 2018
db13a2b
RememberMeConfigTests groovy->java
jzheaux Jul 23, 2018
287c4b9
Add additional parameters to OAuth2UserRequest
jgrandja Aug 13, 2018
16b0784
Make ClientRegistration.clientSecret optional
jgrandja Aug 14, 2018
6b890ff
Relax validation on ClientRegistration
jgrandja Aug 14, 2018
742716f
OIDC Provider Configuration - ClientRegistrations
jzheaux Aug 14, 2018
43ee29a
Fix the broken link in the WebSocket documentation
fdesu Aug 16, 2018
301e598
Add support for Feature-Policy security header
vpavic Aug 15, 2018
5144c03
Jwt Claim Validation
jzheaux Jul 24, 2018
b0e6881
Polish JwtValidators
rwinch Aug 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 4 additions & 19 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,12 @@ try {
}
}
},
springio: {
stage('Spring IO') {
node {
checkout scm
try {
sh "./gradlew clean springIoCheck -PplatformVersion=Cairo-BUILD-SNAPSHOT -PexcludeProjects='**/samples/**' --refresh-dependencies --no-daemon --stacktrace"
} catch(Exception e) {
currentBuild.result = 'FAILED: springio'
throw e
} finally {
junit '**/build/spring-io*-results/*.xml'
}
}
}
},
snapshots: {
stage('Snapshot Tests') {
node {
checkout scm
try {
sh "./gradlew clean test -PspringVersion='5.+' -PreactorVersion=Bismuth-BUILD-SNAPSHOT -PspringDataVersion=Kay-BUILD-SNAPSHOT --refresh-dependencies --no-daemon --stacktrace"
sh "./gradlew clean test -PspringVersion='5.+' -PreactorVersion=Californium-BUILD-SNAPSHOT -PspringDataVersion=Lovelace-BUILD-SNAPSHOT --refresh-dependencies --no-daemon --stacktrace"
} catch(Exception e) {
currentBuild.result = 'FAILED: snapshots'
throw e
Expand All @@ -73,7 +58,7 @@ try {
checkout scm
try {
withEnv(["JAVA_HOME=${ tool 'jdk9' }"]) {
sh "./gradlew clean test --no-daemon --stacktrace"
sh "./gradlew clean test --refresh-dependencies --no-daemon --stacktrace"
}
} catch(Exception e) {
currentBuild.result = 'FAILED: jdk9'
Expand All @@ -88,7 +73,7 @@ try {
checkout scm
try {
withEnv(["JAVA_HOME=${ tool 'jdk10' }"]) {
sh "./gradlew clean test --no-daemon --stacktrace"
sh "./gradlew clean test --refresh-dependencies --no-daemon --stacktrace"
}
} catch(Exception e) {
currentBuild.result = 'FAILED: jdk10'
Expand All @@ -103,7 +88,7 @@ try {
checkout scm
try {
withEnv(["JAVA_HOME=${ tool 'jdk11' }"]) {
sh "./gradlew clean test --no-daemon --stacktrace"
sh "./gradlew clean test --refresh-dependencies --no-daemon --stacktrace"
}
} catch(Exception e) {
currentBuild.result = 'FAILED: jdk11'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ public void testDiskSerializationOfMutableAclObjectInstance() throws Exception {

Object retrieved1 = FieldUtils.getProtectedFieldValue("aclAuthorizationStrategy",
retrieved);
assertThat(retrieved1).isEqualTo(null);
assertThat(retrieved1).isNull();

Object retrieved2 = FieldUtils.getProtectedFieldValue(
"permissionGrantingStrategy", retrieved);
assertThat(retrieved2).isEqualTo(null);
assertThat(retrieved2).isNull();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
dependencies {
classpath 'io.spring.gradle:spring-build-conventions:0.0.15.RELEASE'
classpath 'io.spring.gradle:spring-build-conventions:0.0.16.RELEASE'
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void ignoresClassesItDoesNotSupport() throws Exception {
assertThat(cap.supports(TestingAuthenticationToken.class)).isFalse();

// Try it anyway
assertThat(cap.authenticate(token)).isEqualTo(null);
assertThat(cap.authenticate(token)).isNull();
}

@Test
Expand All @@ -370,7 +370,7 @@ public void ignoresUsernamePasswordAuthenticationTokensWithoutCasIdentifiersAsPr
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
"some_normal_user", "password",
AuthorityUtils.createAuthorityList("ROLE_A"));
assertThat(cap.authenticate(token)).isEqualTo(null);
assertThat(cap.authenticate(token)).isNull();
}

@Test
Expand Down
3 changes: 3 additions & 0 deletions config/spring-security-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
optional project(':spring-security-messaging')
optional project(':spring-security-oauth2-client')
optional project(':spring-security-oauth2-jose')
optional project(':spring-security-oauth2-resource-server')
optional project(':spring-security-openid')
optional project(':spring-security-web')
optional 'io.projectreactor:reactor-core'
Expand All @@ -34,7 +35,9 @@ dependencies {
testCompile apachedsDependencies
testCompile powerMock2Dependencies
testCompile spockDependencies
testCompile 'com.squareup.okhttp3:mockwebserver'
testCompile 'ch.qos.logback:logback-classic'
testCompile 'io.projectreactor.netty:reactor-netty'
testCompile 'javax.annotation:jsr250-api:1.0'
testCompile 'javax.xml.bind:jaxb-api'
testCompile 'ldapsdk:ldapsdk:4.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public O getOrBuild() {
* invokes {@link SecurityConfigurerAdapter#setBuilder(SecurityBuilder)}.
*
* @param configurer
* @return
* @return the {@link SecurityConfigurerAdapter} for further customizations
* @throws Exception
*/
@SuppressWarnings("unchecked")
Expand All @@ -140,7 +140,7 @@ public <C extends SecurityConfigurerAdapter<O, B>> C apply(C configurer)
* are not considered.
*
* @param configurer
* @return
* @return the {@link SecurityConfigurerAdapter} for further customizations
* @throws Exception
*/
public <C extends SecurityConfigurer<O, B>> C apply(C configurer) throws Exception {
Expand Down Expand Up @@ -172,7 +172,7 @@ public <C> C getSharedObject(Class<C> sharedType) {

/**
* Gets the shared objects
* @return
* @return the shared Objects
*/
public Map<Class<? extends Object>, Object> getSharedObjects() {
return Collections.unmodifiableMap(this.sharedObjects);
Expand Down Expand Up @@ -214,7 +214,7 @@ private <C extends SecurityConfigurer<O, B>> void add(C configurer) throws Excep
* List if not found. Note that object hierarchies are not considered.
*
* @param clazz the {@link SecurityConfigurer} class to look for
* @return
* @return a list of {@link SecurityConfigurer}s for further customization
*/
@SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> List<C> getConfigurers(Class<C> clazz) {
Expand All @@ -230,7 +230,7 @@ public <C extends SecurityConfigurer<O, B>> List<C> getConfigurers(Class<C> claz
* List if not found. Note that object hierarchies are not considered.
*
* @param clazz the {@link SecurityConfigurer} class to look for
* @return
* @return a list of {@link SecurityConfigurer}s for further customization
*/
@SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> List<C> removeConfigurers(Class<C> clazz) {
Expand All @@ -246,7 +246,7 @@ public <C extends SecurityConfigurer<O, B>> List<C> removeConfigurers(Class<C> c
* found. Note that object hierarchies are not considered.
*
* @param clazz
* @return
* @return the {@link SecurityConfigurer} for further customizations
*/
@SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> C getConfigurer(Class<C> clazz) {
Expand Down Expand Up @@ -359,7 +359,7 @@ protected void beforeConfigure() throws Exception {
/**
* Subclasses must implement this method to build the object that is being returned.
*
* @return
* @return the Object to be buit or null if the implementation allows it
*/
protected abstract O performBuild() throws Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void configure(B builder) throws Exception {
* Return the {@link SecurityBuilder} when done using the {@link SecurityConfigurer}.
* This is useful for method chaining.
*
* @return
* @return the {@link SecurityBuilder} for further customizations
*/
public B and() {
return getBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected ProviderManager performBuild() throws Exception {
* default configuration in the {@link SecurityConfigurer#configure(SecurityBuilder)}
* method.
*
* @return
* @return true, if {@link AuthenticationManagerBuilder} is configured, otherwise false
*/
public boolean isConfigured() {
return !authenticationProviders.isEmpty() || parentAuthenticationManager != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ public boolean matches(CharSequence rawPassword,
return getPasswordEncoder().matches(rawPassword, encodedPassword);
}

@Override
public boolean upgradeEncoding(String encodedPassword) {
return getPasswordEncoder().upgradeEncoding(encodedPassword);
}

private PasswordEncoder getPasswordEncoder() {
if (this.passwordEncoder != null) {
return this.passwordEncoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.core.userdetails.UserDetailsPasswordService;

/**
* Lazily initializes the global authentication with a {@link UserDetailsService} if it is
Expand Down Expand Up @@ -65,12 +66,16 @@ public void configure(AuthenticationManagerBuilder auth) throws Exception {
}

PasswordEncoder passwordEncoder = getBeanOrNull(PasswordEncoder.class);
UserDetailsPasswordService passwordManager = getBeanOrNull(UserDetailsPasswordService.class);

DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(userDetailsService);
if (passwordEncoder != null) {
provider.setPasswordEncoder(passwordEncoder);
}
if (passwordManager != null) {
provider.setUserDetailsPasswordService(passwordManager);
}
provider.afterPropertiesSet();

auth.authenticationProvider(provider);
Expand All @@ -90,4 +95,4 @@ private <T> T getBeanOrNull(Class<T> type) {
.getBean(userDetailsBeanNames[0], type);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public LdapAuthenticationProviderConfigurer<B> userDetailsContextMapper(
/**
* Specifies the attribute name which contains the role name. Default is "cn".
* @param groupRoleAttribute the attribute name that maps a group to a role.
* @return
* @return the {@link LdapAuthenticationProviderConfigurer} for further customizations
*/
public LdapAuthenticationProviderConfigurer<B> groupRoleAttribute(
String groupRoleAttribute) {
Expand Down Expand Up @@ -384,11 +384,11 @@ public void configure(B builder) throws Exception {
*/
public final class PasswordCompareConfigurer {

/**
/**Us
* Allows specifying the {@link PasswordEncoder} to use. The default is
* {@link org.springframework.security.crypto.password.NoOpPasswordEncoder}.
* @param passwordEncoder the {@link PasswordEncoder} to use
* @return the {@link PasswordEncoder} to use
* @return the {@link PasswordCompareConfigurer} for further customizations
*/
public PasswordCompareConfigurer passwordEncoder(PasswordEncoder passwordEncoder) {
LdapAuthenticationProviderConfigurer.this.passwordEncoder = passwordEncoder;
Expand Down Expand Up @@ -602,7 +602,7 @@ private BaseLdapPathContextSource getContextSource() throws Exception {
}

/**
* @return
* @return the {@link PasswordCompareConfigurer} for further customizations
*/
public PasswordCompareConfigurer passwordCompare() {
return new PasswordCompareConfigurer().passwordAttribute("password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public JdbcUserDetailsManagerConfigurer() {
* Populates the {@link DataSource} to be used. This is the only required attribute.
*
* @param dataSource the {@link DataSource} to be used. Cannot be null.
* @return
* @return The {@link JdbcUserDetailsManagerConfigurer} used for additional customizations
* @throws Exception
*/
public JdbcUserDetailsManagerConfigurer<B> dataSource(DataSource dataSource)
Expand Down Expand Up @@ -142,7 +142,7 @@ public JdbcUserDetailsManagerConfigurer<B> groupAuthoritiesByUsername(String que
* storage (default is "").
*
* @param rolePrefix
* @return
* @return The {@link JdbcUserDetailsManagerConfigurer} used for additional customizations
* @throws Exception
*/
public JdbcUserDetailsManagerConfigurer<B> rolePrefix(String rolePrefix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected void initUserDetailsService() throws Exception {
* method can be invoked multiple times to add multiple users.
*
* @param userDetails the user to add. Cannot be null.
* @return
* @return the {@link UserDetailsBuilder} for further customizations
*/
@SuppressWarnings("unchecked")
public final C withUser(UserDetails userDetails) {
Expand All @@ -82,7 +82,7 @@ public final C withUser(UserDetails userDetails) {
* method can be invoked multiple times to add multiple users.
*
* @param userBuilder the user to add. Cannot be null.
* @return
* @return the {@link UserDetailsBuilder} for further customizations
*/
@SuppressWarnings("unchecked")
public final C withUser(User.UserBuilder userBuilder) {
Expand All @@ -95,7 +95,7 @@ public final C withUser(User.UserBuilder userBuilder) {
* method can be invoked multiple times to add multiple users.
*
* @param username the username for the user being added. Cannot be null.
* @return
* @return the {@link UserDetailsBuilder} for further customizations
*/
@SuppressWarnings("unchecked")
public final UserDetailsBuilder withUser(String username) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.security.config.annotation.authentication.ProviderManagerBuilder;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.core.userdetails.UserDetailsPasswordService;

/**
* Allows configuring a {@link DaoAuthenticationProvider}
Expand All @@ -46,6 +47,9 @@ abstract class AbstractDaoAuthenticationConfigurer<B extends ProviderManagerBuil
protected AbstractDaoAuthenticationConfigurer(U userDetailsService) {
this.userDetailsService = userDetailsService;
provider.setUserDetailsService(userDetailsService);
if (userDetailsService instanceof UserDetailsPasswordService) {
this.provider.setUserDetailsPasswordService((UserDetailsPasswordService) userDetailsService);
}
}

/**
Expand All @@ -65,14 +69,19 @@ public C withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor) {
* {@link DaoAuthenticationProvider}. The default is to use plain text.
*
* @param passwordEncoder The {@link PasswordEncoder} to use.
* @return
* @return the {@link AbstractDaoAuthenticationConfigurer} for further customizations
*/
@SuppressWarnings("unchecked")
public C passwordEncoder(PasswordEncoder passwordEncoder) {
provider.setPasswordEncoder(passwordEncoder);
return (C) this;
}

public C userDetailsPasswordManager(UserDetailsPasswordService passwordManager) {
provider.setUserDetailsPasswordService(passwordManager);
return (C) this;
}

@Override
public void configure(B builder) throws Exception {
provider = postProcess(provider);
Expand Down
Loading