Troubleshooting OpenID Connect
출처: 문서
본문
OpenID Connect 문제 해결
Security 플러그인으로 OpenSearch 인증에 OpenID Connect를 사용할 때 발생하는 문제를 해결하려면 다음 문제 해결 단계를 따라 해 보세요.
목차
- TOC {:toc}
로그 레벨을 debug로 설정
OpenID Connect 문제를 해결하는 데 도움이 되도록 OpenSearch에서 로그 레벨을 debug로 설정하세요. config/log4j2.properties에 다음 줄을 추가하고 노드를 재시작하세요:
logger.securityjwt.name = com.amazon.dlic.auth.http.jwt
logger.securityjwt.level = trace
이 설정은 로그 파일에 유용한 정보를 많이 출력해 줘요. 이 정보로 부족하다면 로그 레벨을 trace로 설정할 수도 있어요.
"Failed when trying to obtain the endpoints from your IdP"
이 오류는 Security 플러그인이 IdP의 메타데이터 엔드포인트에 도달하지 못한다는 뜻이에요. opensearch_dashboards.yml에서 다음 설정을 확인하세요:
plugins.security.openid.connect_url: "http://keycloak.example.com:8080/auth/realms/master/.well-known/openid-configuration"
이 오류가 OpenSearch에서 발생한다면 config.yml에서 다음 설정을 확인하세요:
openid_auth_domain:
enabled: true
order: 1
http_authenticator:
type: "openid"
...
config:
openid_connect_url: http://keycloak.examplesss.com:8080/auth/realms/master/.well-known/openid-configuration
...
"ValidationError: child 'opensearch_security' fails"
OpenSearch Dashboards 설정 중 하나 이상이 빠져 있다는 뜻이에요.
opensearch_dashboards.yml을 확인하고 다음 최소 설정이 되어 있는지 확인하세요:
plugins.security.openid.connect_url: "..."
plugins.security.openid.client_id: "..."
plugins.security.openid.client_secret: "..."
"Authentication failed. Please provide a new token."
이 오류에는 여러 가지 원인이 있을 수 있어요.
남아 있는 쿠키나 캐시된 자격 증명
브라우저에 캐시된 데이터를 모두 삭제하거나, 시크릿 브라우저 창에서 다시 시도해 보세요.
잘못된 client secret
액세스 토큰을 ID 토큰으로 교환할 때 대부분의 IdP는 client secret을 제공하도록 요구해요. opensearch_dashboards.yml의 client secret이 IdP 설정의 client secret과 일치하는지 확인하세요:
plugins.security.openid.client_secret: "..."
"Failed to get subject from JWT claims"
이 오류는 OpenSearch에 기록되며, ID 토큰에서 사용자 이름을 추출하지 못했다는 뜻이에요. 다음 설정이 IdP가 발급하는 JWT의 클레임과 일치하는지 확인하세요:
openid_auth_domain:
enabled: true
order: 1
http_authenticator:
type: "openid"
...
config:
subject_key: <subject key>
...
"Failed to get roles from JWT claims with roles_key"
이 오류는 config.yml에서 설정한 roles key가 IdP가 발급한 JWT에 존재하지 않는다는 뜻이에요. 다음 설정이 IdP가 발급하는 JWT의 클레임과 일치하는지 확인하세요:
openid_auth_domain:
enabled: true
order: 1
http_authenticator:
type: "openid"
...
config:
roles_key: <roles key>
...