config相关配置。

This commit is contained in:
Renpc-kilig 2021-01-21 17:25:46 +08:00
parent d96f205eda
commit 133ce514b5

View File

@ -35,22 +35,23 @@ public class AuthClientSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.formLogin() http
.defaultSuccessUrl("/authorize", true) .formLogin()
.and() .defaultSuccessUrl("/authorize", true)
.logout().logoutSuccessUrl(authServer.getOauthLogout()) .and()
.and() .logout().logoutSuccessUrl(authServer.getOauthLogout())
.authorizeRequests().antMatchers("/app/**", "/route/file/**", "/assets/**","/resource/**").permitAll() .and()
.and() .authorizeRequests().antMatchers("/app/**","/resource/**", "/route/file/**", "/assets/**").permitAll()
.authorizeRequests() .and()
.anyRequest() .authorizeRequests()
.access("@clientRbacService.hasPermission(request, authentication)") .anyRequest()
.and() .access("@clientRbacService.hasPermission(request, authentication)")
.headers().frameOptions().sameOrigin() .and()
.and() .headers().frameOptions().sameOrigin()
.cors() .and()
.and() .cors()
.csrf().disable(); .and()
.csrf().disable();
} }
@Bean @Bean