авторизация #4
BIN
data/db.mv.db
BIN
data/db.mv.db
Binary file not shown.
@ -40,14 +40,12 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
http.csrf()
|
http.csrf().disable();
|
||||||
.disable();
|
http.headers().frameOptions().disable();
|
||||||
log.debug("Security enabled");
|
log.debug("Security enabled");
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
.antMatchers("/").permitAll()
|
.antMatchers("/").permitAll()
|
||||||
.antMatchers("/login").permitAll()
|
.antMatchers("/login", "/index", "/news/*", "/h2-console/*", "/h2-console").permitAll()
|
||||||
.antMatchers("/index").permitAll()
|
|
||||||
.antMatchers("/news/*").permitAll()
|
|
||||||
.antMatchers("/swagger-ui.html").hasAuthority(UserRoleConstants.ADMIN)
|
.antMatchers("/swagger-ui.html").hasAuthority(UserRoleConstants.ADMIN)
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and()
|
.and()
|
||||||
|
Loading…
Reference in New Issue
Block a user