Skip to content

Commit

Permalink
Merge pull request #169 from Kusitms-29th-MeetUp-H/feat/166-socket
Browse files Browse the repository at this point in the history
[fix]:Socket 수정
  • Loading branch information
qogustj authored May 23, 2024
2 parents d1056d1 + a476e33 commit ecb7946
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {

@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
final String accessToken = getAccessTokenFromHttpServletRequest(request);
jwtProvider.validateAccessToken(accessToken);
final Long userId = jwtProvider.getSubject(accessToken);
setAuthentication(request, userId);
filterChain.doFilter(request, response);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ public class SecurityConfig {

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http
.formLogin(AbstractHttpConfigurer::disable)
.httpBasic(AbstractHttpConfigurer::disable)
.csrf(AbstractHttpConfigurer::disable)
.sessionManagement(sessionManagementConfigurer ->
sessionManagementConfigurer.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.exceptionHandling(exceptionHandlingConfigurer ->
exceptionHandlingConfigurer.authenticationEntryPoint(jwtAuthenticationEntryPoint))
.authorizeHttpRequests(authorizationManagerRequestMatcherRegistry ->
authorizationManagerRequestMatcherRegistry.requestMatchers("/ws/**","/wss/**").permitAll().anyRequest().authenticated())
.addFilterBefore(new JwtAuthenticationFilter(jwtProvider), UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(new ExceptionHandlerFilter(), JwtAuthenticationFilter.class)
.build();
http.cors(AbstractHttpConfigurer::disable);

http.csrf(AbstractHttpConfigurer::disable);

http.authorizeHttpRequests(request ->{
request.anyRequest().permitAll();
});

http.formLogin(AbstractHttpConfigurer::disable);
http.httpBasic(AbstractHttpConfigurer::disable);
http.logout(AbstractHttpConfigurer::disable);
http.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS));

return http.build();
}

}

0 comments on commit ecb7946

Please sign in to comment.