Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Main configuration is located in WebSecurityConfig.java
  • Custom extended Form.java is used to add hidden field with CSRF token. 
  • Ajax client configuration is done in MidPointApplication.java where we inject CSRF token for all POST AJAX requests.
  • Custom MidPointAccessDeniedHandler.java is used for simple redirect to login page when session is invalid or doesn't contain correct CSRF token.

Web services are not protected by CSRF. Configuration is located in WebSecurityConfig.java, in fact spring security ignores web services URL's. Security for services is handled manually via CXF interceptors.

Configuration

To disable CSRF protection one has to create application.yml inside midpoint.home folder. Add following key to this configuration file.

...