Created
November 29, 2015 22:42
-
-
Save khamiltonuk/3f7391ff475aadafae53 to your computer and use it in GitHub Desktop.
Simple CSRF Protection with Spring MVC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| public class SellerWebsiteInterceptorsConfig | |
| extends WebMvcConfigurerAdapter { | |
| @Autowired | |
| private SecureTokenService secureTokenService; | |
| @Override | |
| public void addInterceptors(InterceptorRegistry registry) { | |
| // Put your other interceptors here too …. | |
| registry.addInterceptor(secureTokenInterceptor()); | |
| } | |
| @Bean | |
| public HandlerInterceptor secureTokenInterceptor() { | |
| return new SecureTokenInterceptor(secureTokenService); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment