인프런 커뮤니티 질문&답변

작성자 없음

작성자 정보가 삭제된 글입니다.

스프링부트 JUnit 테스트 - 시큐리티를 활용한 Bank 애플리케이션

authorization 테스트

JwtAuthorizationfilter test mvc.performget 부

작성

·

147

0

이부분을 urltemplate으로 받아야하는데 array로 받네요 어떻게 하면 url로 받을 수 있을까요?

답변 1

0

최주호님의 프로필 이미지
최주호
지식공유자

이거 혹시 get 메서드가 다른 메서드가 호출된건 아닌가요?

 

github 전체 코드 볼 수있을까요?

https://github.com/kimjeonggeon/bankapplication.git
2-bankapplication branch 입니다! 그리고 저번에 올렸던 질문인데 해결을 못해서요.. 그 이번에 accountcontroller 부분에서 로그인 확인을 postman을 통해 하는데 username을 보냈는데 로그인 실패 response로 안오고 error 만 뜹니다.


아래는 오류 코드 입니다.

감사합니다.
org.springframework.security.authentication.InternalAuthenticationServiceException: 인증 실패

at shop.mtcoding.bank.config.auth.LoginService.lambda$loadUserByUsername$0(LoginService.java:23)

at java.base/java.util.Optional.orElseThrow(Optional.java:408)

at shop.mtcoding.bank.config.auth.LoginService.loadUserByUsername(LoginService.java:22)

at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:94)

at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:133)

at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182)

at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:201)

at shop.mtcoding.bank.config.jwt.JwtAuthenticationFilter.attemptAuthentication(JwtAuthenticationFilter.java:50)

at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)

at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)

at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)

at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)

작성자 없음

작성자 정보가 삭제된 글입니다.

질문하기