인프런 커뮤니티 질문&답변
혹시 login 주소 변경과 jwt 토큰을 header에 말고 dto에 담아서 보낼 수 있을까요?
작성
·
497
0
좋은 강의 감사합니다. 혹시 login 주소를 http://localhost:8080/api/v1/login으로 변경하고 싶어 SecurityConfig를 아래와 같이 변경하였습니다.
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
JwtAuthenticationFilter jwtAuthenticationFilter = new JwtAuthenticationFilter(
authenticationManager());
jwtAuthenticationFilter.setFilterProcessesUrl("/api/member/login");
httpSecurity
// token을 사용하는 방식이기 때문에 csrf를 disable합니다.
.csrf().disable()
.addFilter(corsFilter)
.formLogin().disable()
.httpBasic().disable()
.addFilter(jwtAuthenticationFilter)
.addFilter(new JwtAuthorizationFilter(authenticationManager(),getMemberQuery))
혹시 좀 더 괜찮은 방법이 있을까요?
그리고 jwt토큰을 header에 말고 dto로 만들어서 던져주고 싶은데 filter로 하는 방법이 있을까요?
답변 1
2
최주호
지식공유자
우선 1번
/login -> 이것에 대한 주소를 변경하고 싶다면 찾아보셔야 해요.
저는 한번도 변경을 해본적이 없어서 저도 마찬가지로 찾아봐야 합니다.
당연히 찾아보면 방법이 있을 거에요 !!
2번 답
jwt토큰을 header에 담아야 해요. 이건 프로토콜입니다. (약속)
body에 담아도 되지만 좋지 않은 방법입니다.





