1

I have Spring Boot application which use Spring Security OAuth2 as the protection. The application worked well when tested using default server. However, when I try to deploy it on JBoss EAP 6.4 , the application expects the CSRF token. How do I disable JBoss' basic authentication so that my application does not require CSRF token?

EDIT:

As I have described at the comment for sadasidha's answer, this problem didn't show up on Wildfly 8 (JBoss AS)

IllSc
  • 1,419
  • 3
  • 17
  • 24

2 Answers2

0

Disable csrf protection. It's enabled by default

@Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // Disable 
        http.csrf().disable();
    // ...... }
mirmdasif
  • 6,014
  • 2
  • 22
  • 28
  • Nope, still asking for the CSRF token. Btw, when I use the default server, I don't have to disable the CSRF, it is automatically disabled. I can;t use CSRF because I'm developing API which is accessed with CURL – IllSc May 11 '15 at 07:50
  • Surprisingly my application run well on Wildfly 8 (JBoss AS). – IllSc May 11 '15 at 08:29
  • can you give me your log – mirmdasif May 11 '15 at 08:51
0

I have found the solution. Actually it is the result of mapping problem. I'm following the solution from Spring Java Config vs Jboss 7

Community
  • 1
  • 1
IllSc
  • 1,419
  • 3
  • 17
  • 24