728x90
오류현상
스프링 시큐리티로 로그인 시도시 아래와 같은 화면 뜸
summernote lite버젼 설치 후 정적파일 못 찾는게 있어서 이런 현상이었던것 같음
문제 해결에 도움되었던 내용
https://www.inflearn.com/questions/31659
오류 해결 구문 핵심(.antMatchers("/","/logout", "/auth/**","/favicon.ico", "/resources/**", "/error"))
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable() //csrf 토큰 비활성화
.authorizeRequests()
.antMatchers("/","/logout", "/auth/**","/favicon.ico", "/resources/**", "/error")
.permitAll()
.anyRequest()
.authenticated()
.and()
.formLogin()
.usernameParameter("loginUserId")//.JSP에서 전송오는 name="loginUserId"이면 default값인 username과 다르므로 해당 설정해줘야함.
.passwordParameter("loginPpassword")
.loginPage("/") // 인증이 필요한 곳으로 요청오면 해당 주소로 이동
.loginProcessingUrl("/auth/loginProc") //해당 주소에서 로그인 처리, 해당 페이지 안만들어도 시큐리티가 가로채서 username 확인하게된다.
.failureHandler(customFailurHandler) // 실패 핸들러
.defaultSuccessUrl("/");
}
오류 해결 수정버젼
이미지 파일이 깨지길래 다시 구구절절 써줬다.
.antMatchers("/","/logout", "/auth/**", "/js/**", "/css/**", "/image/**","/favicon.ico", "/resources/**", "/error")
이미지도 잘 뜨고 로그인도 잘 된다.
728x90
'Spring (boot) 오류 해결' 카테고리의 다른 글
{"readystate": 4, "responseText":"\r\n (0) | 2022.02.06 |
---|---|
마이바티스 MySQL TINYINT(boolean)=0,1값과 java Boolean=true,false 변환 (0) | 2022.02.05 |
부트스트랩 5버젼과 섬머노트 부트스트랩 4버젼 충돌 해결 (2) | 2022.02.03 |
Uncaught TypeError: $(...).summernote is not a function (0) | 2022.02.03 |
uncaught referenceerror $ is not defined (0) | 2022.02.03 |
댓글