mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 17:22:13 +00:00
SEC-2336: WebSecurityConfigurerAdapter#registerAuthentication javadoc fixes
This commit is contained in:
parent
1f3b812a66
commit
56ce7d284c
@ -104,29 +104,50 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by the default implementation of {@link #authenticationManager()} to attempt to obtain an
|
* Used by the default implementation of {@link #authenticationManager()} to
|
||||||
* {@link AuthenticationManager}. If overridden, the {@link AuthenticationManagerBuilder} should be used to specify
|
* attempt to obtain an {@link AuthenticationManager}. If overridden, the
|
||||||
* the {@link AuthenticationManager}. The resulting {@link AuthenticationManager}
|
* {@link AuthenticationManagerBuilder} should be used to specify the
|
||||||
* will be exposed as a Bean as will the last populated {@link UserDetailsService} that is created with the
|
* {@link AuthenticationManager}.
|
||||||
* {@link AuthenticationManagerBuilder}. The {@link UserDetailsService} will also automatically be populated on
|
|
||||||
* {@link HttpSecurity#getSharedObject(Class)} for use with other {@link SecurityContextConfigurer}
|
|
||||||
* (i.e. RememberMeConfigurer )
|
|
||||||
*
|
*
|
||||||
* <p>For example, the following configuration could be used to register
|
* <p>
|
||||||
* in memory authentication that exposes an in memory {@link UserDetailsService}:</p>
|
* The {@link #authenticationManagerBean()} method can be used to expose the
|
||||||
|
* resulting {@link AuthenticationManager} as a Bean. The
|
||||||
|
* {@link #userDetailsServiceBean()} can be used to expose the last
|
||||||
|
* populated {@link UserDetailsService} that is created with the
|
||||||
|
* {@link AuthenticationManagerBuilder} as a Bean. The
|
||||||
|
* {@link UserDetailsService} will also automatically be populated on
|
||||||
|
* {@link HttpSecurity#getSharedObject(Class)} for use with other
|
||||||
|
* {@link SecurityContextConfigurer} (i.e. RememberMeConfigurer )
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, the following configuration could be used to register in
|
||||||
|
* memory authentication that exposes an in memory
|
||||||
|
* {@link UserDetailsService}:
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* @Override
|
* @Override
|
||||||
* protected void registerAuthentication(AuthenticationManagerBuilder auth) {
|
* protected void registerAuthentication(AuthenticationManagerBuilder auth) {
|
||||||
* auth
|
* auth
|
||||||
* // enable in memory based authentication with a user named "user" and "admin"
|
* // enable in memory based authentication with a user named
|
||||||
|
* // "user" and "admin"
|
||||||
* .inMemoryAuthentication()
|
* .inMemoryAuthentication()
|
||||||
* .withUser("user").password("password").roles("USER").and()
|
* .withUser("user").password("password").roles("USER").and()
|
||||||
* .withUser("admin").password("password").roles("USER", "ADMIN");
|
* .withUser("admin").password("password").roles("USER", "ADMIN");
|
||||||
* }
|
* }
|
||||||
|
*
|
||||||
|
* // Expose the UserDetailsService as a Bean
|
||||||
|
* @Bean
|
||||||
|
* @Override
|
||||||
|
* public UserDetailsService userDetailsServiceBean() throws Exception {
|
||||||
|
* return super.userDetailsServiceBean();
|
||||||
|
* }
|
||||||
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param auth the {@link AuthenticationManagerBuilder} to use
|
* @param auth
|
||||||
|
* the {@link AuthenticationManagerBuilder} to use
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {
|
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user