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().authorizeRequests()
- http.csrf().disable().httpBasic().and().authorizeRequests().antMatchers(HttpMethod.POST, SIGN_UP_URL)
- .permitAll().anyRequest().authenticated().and()
- .addFilter(new JWTAuthenticationFilter(authenticationManager()))
- .addFilter(new JWTAuthorizationFilter(authenticationManager())).sessionManagement()
- .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
- }
- @Override
- public void configure(AuthenticationManagerBuilder auth) throws Exception {
- auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder);
- }
- @Bean
- CorsConfigurationSource corsConfigurationSource() {
- final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
- source.registerCorsConfiguration("/**", new CorsConfiguration().applyPermitDefaultValues());
- return source;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement