UserDetailsRepositoryAuthenticationManager->UserDetailsRepositoryReactiveAuthenticationManager
Issue gh-4615
This commit is contained in:
parent
4681697581
commit
5502856095
|
@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.ReactiveAdapterRegistry;
|
||||
import org.springframework.security.authentication.ReactiveAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager;
|
||||
import org.springframework.security.config.web.server.HttpSecurity;
|
||||
import org.springframework.security.core.userdetails.ReactiveUserDetailsService;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
@ -77,8 +77,8 @@ public class HttpSecurityConfiguration implements WebFluxConfigurer {
|
|||
return this.authenticationManager;
|
||||
}
|
||||
if(this.reactiveUserDetailsService != null) {
|
||||
UserDetailsRepositoryAuthenticationManager manager =
|
||||
new UserDetailsRepositoryAuthenticationManager(this.reactiveUserDetailsService);
|
||||
UserDetailsRepositoryReactiveAuthenticationManager manager =
|
||||
new UserDetailsRepositoryReactiveAuthenticationManager(this.reactiveUserDetailsService);
|
||||
if(this.passwordEncoder != null) {
|
||||
manager.setPasswordEncoder(this.passwordEncoder);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.openqa.selenium.WebElement;
|
|||
import org.openqa.selenium.support.FindBy;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
import org.springframework.security.authentication.ReactiveAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager;
|
||||
import org.springframework.security.core.userdetails.MapReactiveUserDetailsService;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
@ -45,7 +45,7 @@ public class FormLoginTests {
|
|||
private UserDetails user = User.withUsername("user").password("password").roles("USER").build();
|
||||
private HttpSecurity http = HttpSecurity.http();
|
||||
|
||||
ReactiveAuthenticationManager manager = new UserDetailsRepositoryAuthenticationManager(new MapReactiveUserDetailsService(this.user));
|
||||
ReactiveAuthenticationManager manager = new UserDetailsRepositoryReactiveAuthenticationManager(new MapReactiveUserDetailsService(this.user));
|
||||
|
||||
@Test
|
||||
public void defaultLoginPage() {
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.springframework.security.config.web.server;
|
|||
import org.junit.Test;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.springframework.security.authentication.ReactiveAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryAuthenticationManager;
|
||||
import org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager;
|
||||
import org.springframework.security.core.userdetails.MapReactiveUserDetailsService;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
@ -37,7 +37,7 @@ public class LogoutBuilderTests {
|
|||
private UserDetails user = User.withUsername("user").password("password").roles("USER").build();
|
||||
private HttpSecurity http = HttpSecurity.http();
|
||||
|
||||
ReactiveAuthenticationManager manager = new UserDetailsRepositoryAuthenticationManager(new MapReactiveUserDetailsService(this.user));
|
||||
ReactiveAuthenticationManager manager = new UserDetailsRepositoryReactiveAuthenticationManager(new MapReactiveUserDetailsService(this.user));
|
||||
|
||||
@Test
|
||||
public void defaultLogout() {
|
||||
|
|
|
@ -29,12 +29,12 @@ import reactor.core.scheduler.Schedulers;
|
|||
* @author Rob Winch
|
||||
* @since 5.0
|
||||
*/
|
||||
public class UserDetailsRepositoryAuthenticationManager implements ReactiveAuthenticationManager {
|
||||
public class UserDetailsRepositoryReactiveAuthenticationManager implements ReactiveAuthenticationManager {
|
||||
private final ReactiveUserDetailsService repository;
|
||||
|
||||
private PasswordEncoder passwordEncoder = NoOpPasswordEncoder.getInstance();
|
||||
|
||||
public UserDetailsRepositoryAuthenticationManager(ReactiveUserDetailsService reactiveUserDetailsService) {
|
||||
public UserDetailsRepositoryReactiveAuthenticationManager(ReactiveUserDetailsService reactiveUserDetailsService) {
|
||||
Assert.notNull(reactiveUserDetailsService, "userDetailsRepository cannot be null");
|
||||
this.repository = reactiveUserDetailsService;
|
||||
}
|
|
@ -42,13 +42,13 @@ public class ReactiveUserDetailsServiceAuthenticationManagerTests {
|
|||
@Mock ReactiveUserDetailsService repository;
|
||||
@Mock
|
||||
PasswordEncoder passwordEncoder;
|
||||
UserDetailsRepositoryAuthenticationManager manager;
|
||||
UserDetailsRepositoryReactiveAuthenticationManager manager;
|
||||
String username;
|
||||
String password;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
manager = new UserDetailsRepositoryAuthenticationManager(repository);
|
||||
manager = new UserDetailsRepositoryReactiveAuthenticationManager(repository);
|
||||
username = "user";
|
||||
password = "pass";
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class ReactiveUserDetailsServiceAuthenticationManagerTests {
|
|||
@Test(expected = IllegalArgumentException.class)
|
||||
public void constructorNullUserDetailsRepository() {
|
||||
ReactiveUserDetailsService udr = null;
|
||||
new UserDetailsRepositoryAuthenticationManager(udr);
|
||||
new UserDetailsRepositoryReactiveAuthenticationManager(udr);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue