본문 바로가기
카테고리 없음

[에러] 스프링 시큐리티

by yeaseul912 2022. 4. 25.
728x90

1. class file 안보일 때

java 파일이 컴파일 되서 class 파일이 되는데 (컴파일)

class 파일 형태로는 볼 수 없어서 다시 java 파일로 바꾸어 줘야함 (디컴파일)

Marketplace에서 Decompile  프로그램을 설치해주면 된다.

https://hyunchang88.tistory.com/328

 

2.  자동 import 안됨 ( control + shift + o )

Preferences > java > Editor > Save Actions 에서

perform the selected actions on save 체크박스 체크

Organize imports 체크박스 체크

https://xzio.tistory.com/1230

 

3. CORS 설정 에러

java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.

allowCredentials를 true로 사용할 때,  response 헤더에 "Access-Control-Allow-Origin"이 없으면 allowedOrigins에 인자로 "*"를 넣을 수 없다. 출처에 대한 자격증명을 하기 위해서 명시적으로 ("Access-Control-Allow-Origin"를 )나열을 하거나, (allowedOrigins) 대신에 allowedOriginPatterns를 사용하는것이 좋습니다.

 

해결방법1. response header에 "Access-Control-Allow-Origin"을 넣어서 응답

해결방법2. allowedOrigins("*")을 allowedOriginPatterns("*")로 수정

 

반응형

댓글