Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http
- .cors()
- .and()
- .csrf()
- .disable()
- .exceptionHandling()
- .authenticationEntryPoint(unauthorizedHandler)
- .and()
- .sessionManagement()
- .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
- .and()
- .authorizeRequests()
- .antMatchers(WHITELIST)
- .permitAll()
- .antMatchers("/api/auth/**")
- .permitAll()
- .anyRequest()
- .authenticated();
- // Add our custom JWT security filter
- http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement