Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] 토큰 권한 설정 오류 #301

Open
heegu123 opened this issue Feb 2, 2025 · 0 comments
Open

[ERROR] 토큰 권한 설정 오류 #301

heegu123 opened this issue Feb 2, 2025 · 0 comments
Assignees
Labels
ERROR 에러, 버그 수정

Comments

@heegu123
Copy link
Contributor

heegu123 commented Feb 2, 2025

00 에러

📄 설명 :

•	권한 문자열이 ROLE_ROLE_ADMIN, ROLE_ROLE_USER 등으로 중복된 접두사를 가지는 문제가 발생.
•	Spring Security에서 기대하는 권한 값 형식(ROLE_ADMIN, ROLE_USER)과 달라 인증 및 권한 검사에서 실패.

❗️ 발생한 에러 :

    •	권한 문자열이 ROLE_ROLE_ADMIN, ROLE_ROLE_USER 등으로 중복된 접두사를 가지는 문제가 발생.
•	Spring Security에서 기대하는 권한 값 형식(ROLE_ADMIN, ROLE_USER)과 달라 인증 및 권한 검사에서 실패.

⭕️ 해결방안 :

    -  JWTFilter.java 수정:
•	CustomUserDetails.getAuthorities() 대신 CustomUserDetails.getRole() 값을 직접 사용하여 권한 리스트를 생성.

📝 메모 :

@heegu123 heegu123 added the ERROR 에러, 버그 수정 label Feb 2, 2025
@heegu123 heegu123 self-assigned this Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ERROR 에러, 버그 수정
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant