SpringSecurity

@Configuration@EnableWebSecuritypublic class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/", "/login**", "/error**").permitAll() .antMatchers("/api/**").permitAll() .anyRequest().authenticated() ..
AuthServer-CorsConfig@Configurationpublic class CorsConfig { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); //새로운 UrlBasedCorsConfigurationSource 객체를 생성합니다. 이 객체는 URL 패턴과 함께 CORS 설정을 등록하는 데 사용됩니다. CorsConfiguration config = new CorsConfiguration(); //새로운 CorsConfiguration 객체를 생성합니다. 이 객체는 CO..
UsernamePasswordAuthenticationToken은 Spring Security에서 사용되는 인증을 나타내는 클래스 중 하나입니다. 주로 사용자명과 비밀번호 기반의 인증 프로세스에서 사용됩니다. 이 클래스는 Authentication 인터페이스를 구현한 구체 클래스로, 사용자의 인증 정보를 담고 인증을 수행하는 데 활용됩니다.주요 특징과 사용 예시는 다음과 같습니다:구성 요소:principal: 인증 주체를 나타내는 객체 (일반적으로 사용자의 username 또는 email)credentials: 인증 주체의 자격 증명 (일반적으로 비밀번호)authorities: 사용자의 권한 목록을 나타내는 객체사용 예시:사용자가 입력한 사용자명(username)과 비밀번호(password)로 Authe..
시큐리티를 사요할때 config에서 특정 경로에 대해서만 csrf,cors를 적용하면 다른경로는 어떻게 되는걸까?
브리오
'SpringSecurity' 카테고리의 글 목록