@@ -0,0 +1,2851 @@
+package com.github.solairerove.facepalm.security.config;%0A%0Aimport com.github.solairerove.facepalm.security.JwtAuthenticationEntryPoint;%0Aimport com.github.solairerove.facepalm.security.JwtAuthenticationTokenFilter;%0Aimport lombok.RequiredArgsConstructor;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.http.HttpMethod;%0Aimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;%0Aimport org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;%0Aimport org.springframework.security.config.annotation.web.builders.HttpSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;%0Aimport org.springframework.security.core.userdetails.UserDetailsService;%0Aimport org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;%0Aimport org.springframework.security.crypto.password.PasswordEncoder;%0Aimport org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;%0A%0Aimport static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;%0A%0A@Configuration%0A@EnableWebSecurity%0A@EnableGlobalMethodSecurity(prePostEnabled = true)%0A@RequiredArgsConstructor(onConstructor = @__(@Autowired))%0Apublic class WebSecurityConfig extends WebSecurityConfigurerAdapter %7B%0A%0A    private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;%0A%0A    private final JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter;%0A%0A    private final UserDetailsService userDetailsService;%0A%0A    @Autowired%0A    public void configureAuthentication(final AuthenticationManagerBuilder managerBuilder) throws Exception %7B%0A        managerBuilder%0A                .userDetailsService(this.userDetailsService)%0A                .passwordEncoder(passwordEncoder());%0A    %7D%0A%0A    @Bean%0A    public PasswordEncoder passwordEncoder() %7B%0A        return new BCryptPasswordEncoder();%0A    %7D%0A%0A    @Override%0A    protected void configure(final HttpSecurity http) throws Exception %7B%0A        http%0A                .csrf().disable()%0A                .exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint)%0A                .and()%0A                .sessionManagement().sessionCreationPolicy(STATELESS)%0A                .and()%0A                .authorizeRequests()%0A                .antMatchers(HttpMethod.GET, %22/%22).permitAll()%0A                .antMatchers(%22/auth/**%22).permitAll()%0A                .anyRequest().authenticated();%0A%0A        http.addFilterBefore(jwtAuthenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);%0A%0A        http.headers().cacheControl();%0A    %7D%0A%7D%0A

write jwt oriented web security config