mirror of
https://github.com/OtusTeam/Spring.git
synced 2026-05-30 10:50:42 +00:00
Пример к занятию SpringSecurity Аутентификация
This commit is contained in:
@@ -30,19 +30,13 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||
.authorizeRequests().antMatchers( "/public" ).anonymous()
|
||||
.and()
|
||||
.authorizeRequests().antMatchers( "/authenticated", "/success" ).authenticated()
|
||||
.and().anonymous().authorities( "ROLE_ANONYMOUS" ).principal( "ya" )
|
||||
|
||||
.and()
|
||||
// Включает Form-based аутентификацию
|
||||
//
|
||||
.formLogin()
|
||||
.formLogin();
|
||||
|
||||
// .and().rememberMe()
|
||||
|
||||
;
|
||||
// http.rememberMe()
|
||||
// .key( "MyDirtySecret" )
|
||||
// .tokenValiditySeconds( 50000 )
|
||||
// ;
|
||||
// ;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
||||
Reference in New Issue
Block a user