Merge branch 'CA_token' into jenkins_with_weblogic
This commit is contained in:
@@ -1,58 +0,0 @@
|
|||||||
package com.eactive.eai.authserver.custom;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
|
||||||
//
|
|
||||||
//@Configuration
|
|
||||||
//@EnableWebSecurity
|
|
||||||
//public class SecurityConfig {
|
|
||||||
//
|
|
||||||
// private final BearerTokenFilter tokenFilter;
|
|
||||||
//
|
|
||||||
// public SecurityConfig(BearerTokenFilter tokenFilter) {
|
|
||||||
// this.tokenFilter = tokenFilter;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Bean
|
|
||||||
// public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
||||||
//
|
|
||||||
// http
|
|
||||||
// .csrf().disable()
|
|
||||||
// .authorizeRequests()
|
|
||||||
// .antMatchers("/auth/token/**").permitAll()
|
|
||||||
// .anyRequest().authenticated()
|
|
||||||
// .and()
|
|
||||||
// .addFilterBefore(tokenFilter, UsernamePasswordAuthenticationFilter.class);
|
|
||||||
//
|
|
||||||
// return http.build();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@Configuration
|
|
||||||
@EnableWebSecurity
|
|
||||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
||||||
|
|
||||||
private final BearerTokenFilter tokenFilter;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public SecurityConfig(BearerTokenFilter tokenFilter) {
|
|
||||||
this.tokenFilter = tokenFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
|
||||||
|
|
||||||
http
|
|
||||||
.csrf().disable()
|
|
||||||
.authorizeRequests()
|
|
||||||
.antMatchers("/auth/token/**").permitAll()
|
|
||||||
.anyRequest().authenticated()
|
|
||||||
.and()
|
|
||||||
.addFilterBefore(tokenFilter, UsernamePasswordAuthenticationFilter.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user