Example usage for org.springframework.security.authentication ReactiveAuthenticationManagerAdapter ReactiveAuthenticationManagerAdapter

List of usage examples for org.springframework.security.authentication ReactiveAuthenticationManagerAdapter ReactiveAuthenticationManagerAdapter

Introduction

In this page you can find the example usage for org.springframework.security.authentication ReactiveAuthenticationManagerAdapter ReactiveAuthenticationManagerAdapter.

Prototype

public ReactiveAuthenticationManagerAdapter(AuthenticationManager authenticationManager) 

Source Link

Usage

From source file:playground.app.Application.java

@Bean
public ReactiveAuthenticationManager authenticationManager() {
    User rob = new User("rob", "rob", AuthorityUtils.createAuthorityList("ROLE_USER"));
    User admin = new User("admin", "admin", AuthorityUtils.createAuthorityList("ROLE_ADMIN", "ROLE_USER"));
    InMemoryUserDetailsManager userDetailsService = new InMemoryUserDetailsManager(Arrays.asList(admin, rob));
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService);
    ProviderManager authenticationManager = new ProviderManager(Arrays.asList(authenticationProvider));
    return new ReactiveAuthenticationManagerAdapter(authenticationManager);
}