mirror of
https://github.com/OpenBankProject/OBP-Hydra-Identity-Provider.git
synced 2026-02-06 10:48:13 +00:00
19 lines
864 B
Java
19 lines
864 B
Java
package com.openbankproject.oauth2;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
|
|
|
|
@Configuration
|
|
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|
@Override
|
|
protected void configure(HttpSecurity http) throws Exception {
|
|
http.csrf().csrfTokenRepository(new CookieCsrfTokenRepository().withHttpOnlyFalse())
|
|
.requireCsrfProtectionMatcher(
|
|
httpServletRequest -> !httpServletRequest.getMethod().equalsIgnoreCase("GET")
|
|
)
|
|
.and().authorizeRequests().anyRequest().permitAll();
|
|
}
|
|
}
|