Skip to content

[🔀 BE] stomp jwtInterceptor 구현#59

Open
yoonsu0325 wants to merge 2 commits intodevelopfrom
feature/be/chat_5
Open

[🔀 BE] stomp jwtInterceptor 구현#59
yoonsu0325 wants to merge 2 commits intodevelopfrom
feature/be/chat_5

Conversation

@yoonsu0325
Copy link
Collaborator

@yoonsu0325 yoonsu0325 commented Feb 27, 2026

🔗 Connected Issue
Closes #(이슈번호)

📅 Development Period
(ex. YYYY.MM.DD ~ YYYY.MM.DD)

📢 Description
stomp jwtInterceptor 구현

✔️ PR Checklist
MR이 아래 사항을 충족하는지 확인해주세요:

  • Merge 방향 및 Branch 확인했습니다.
  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 코드가 정상적으로 동작하는지 테스트했습니다.
  • 해당하는 이슈번호를 올바르게 입력했습니다.

🔖 Note
테스트를 못해봐서 제대로 동작할런지 모르겠어용..

@yoonsu0325 yoonsu0325 changed the title Feature/be/chat 5 [🔀 BE] stomp jwtInterceptor 구현 Feb 27, 2026
@Slf4j
public class JwtChannelInterceptor implements ChannelInterceptor {

private static final String AUTHORIZATION = "Authorization";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문자열 상수 직접 정의 대신 HttpHeaders.AUTHORIZATION 사용해보시는 건 어떤가요

private static final String AUTHORIZATION = "Authorization";
private static final String AUTHORIZATION_LOWER = "authorization";
private static final String SENDER_ID_SESSION_KEY = "senderId";
private static final String GRANT_TYPE = "Bearer ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GRANT_TYPE은 이미 SecurityConstants.Token.GRANT_TYPE 에 공통 상수로 정해져 있는데 대신 사용해보시는 건 어떤가요

Comment on lines +108 to +110
// 혹시 "Bearer"만 있는 형태도 대비
if (rawHeader.startsWith("Bearer ")) {
return rawHeader.substring("Bearer ".length()).trim();
Copy link
Member

@0w0n2 0w0n2 Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Bearer " 이 위에서 상수로 정의되어있는데 여기선 하드코딩 되어있습니다

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JwtTokenProvider 클래스와 JwtAuthenticationService#getAuthentication에 제가 JWT 토큰 관련한 util 메소드를 넣어두었는데 이 클래스에서 활용하긴 어려울까요 ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants