클라이언트 등록시에 127.0.0.1로 등록하는 이유가 뭔가요?
823
작성한 질문수 7
질문을 며칠전 장문으로 올렸는데 추후 강의 들으면서 어느정도 궁금증은 해결했습니다
나머지 궁금한 부분만 간추려서 다시 질문드립니다
이전강의 keycloak이용시에는 redirectUrl을 localhost베이스로만 설정해도 아무 문제 없었는데 왜 Spring Authorization Server는 127.0.0.1베이스로 설정해야만 하는 거죠? localhost로 설정하는 방법은 정녕 없는건가요? 개발시에 127.0.0.1로 접속해서 테스트해야되는것도 은근히 불편한 점이 있는지라 생각해봅니다
답변 1
0
네
현재 Spring Authorization Server 에서 localhost 로 접근하는 것은 내부적으로 차단하고 있습니다.
이 부분을 커스텀하게 설정할 수 있는 API 를 제공하지 않는 것 같습니다.
클라이언트의 redirect_uri 에 한해서 그런 것 같습니다.
보안상 이유로 정한 정책이라 보시면 됩니다.
String requestedRedirectHost = requestedRedirect.getHost();
if (requestedRedirectHost == null || requestedRedirectHost.equals("localhost")) {
// As per https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-01#section-9.7.1
// While redirect URIs using localhost (i.e., "http://localhost:{port}/{path}")
// function similarly to loopback IP redirects described in Section 10.3.3,
// the use of "localhost" is NOT RECOMMENDED.
OAuth2Error error = new OAuth2Error(
OAuth2ErrorCodes.INVALID_REQUEST,
"localhost is not allowed for the redirect_uri (" + requestedRedirectUri + "). " +
"Use the IP literal (127.0.0.1) instead.",
"https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-01#section-9.7.1");
throwError(error, OAuth2ParameterNames.REDIRECT_URI,
authorizationCodeRequestAuthentication, registeredClient, null);
}Spring Authorization Server 자체에 대한 주소를 localhost 로 하는 것은 상관없습니다.
authorization-server 라이브러리 질문이 있습니다.
0
78
1
loadUser 중 Missing attribute 'preferred_username' in attributes 에러 발생
0
79
2
JWT 조회 에 대한 질문
0
75
1
password grant 방식 에러 응답
0
91
3
FormLoginConfigure에서 생성하는 필터
0
79
2
현업에서 springboot를 3.5.5 를 사용해서 공부중인데...
0
287
2
Jdbc 관련 강의 및 깃헙 문의
0
78
1
OAuth2AuthorizedClient 이해 및 활용 강의 내용 질문
0
209
1
UserInfo 엔드포인트 요청 실습
0
75
1
RFC 문서에서의 AccessToken 발급 방식 궁금한점
0
151
1
강의자료.zip 를 다운로드 받았는데 압축이 풀리지 않습니다. 확인 부탁드려요
0
140
2
OIDC SSO 관련 질문 입니다.
0
131
1
AuthenticationEntryPoint 강의 누락 문의
0
123
1
cors설정방법
0
116
1
jwt decoder 토큰 검증 시 질문
0
222
1
클라이언트에서 userinfo 엔드포인트 호출 시 질문
0
187
2
JOSE 구성요소의 api에 관한 질문
0
141
2
스프링 부트 3버전으로 따라가시는 분들 참고하세요
1
532
1
CustomOAuth2AuthenticationFilter 구현 중 질문
0
146
2
AuthenticationManager 생성시점
0
118
1
FormLogin과 Oauth2Client 둘 중 사용하는 시점
0
128
1
postman userinfo 엔드포인트 질문
0
136
2
강의 수강신청하고 듣기 전입니다 질문있습니다.
0
115
1
인증 코드를 통해 발급 받은 토큰의 관리
0
200
1





