OpenID Connect issue with Azure AD

Yes, we are using KeyCloak and use Azure AD for federation in behind it. It’s correctly bootstrapping the email, so it must do some kind of mapping just like the one you mention.

We have a fix. We were using the v1.0 version of the endpoint. When we switch to the v2.0, it works and we get the email just fine. Thanks for all your help @david, talking it through helps us triage the issue.

Glad to hear it!

Would you be able to describe how to tell whether you’re using v1 or v2 in the azure portal? Then we can add a note to the instructions above so it doesn’t catch anyone else!

Yep, adding /v2.0/ to the metadata document url.

https://login.microsoftonline.com/replace-with-tenant-id/v2.0/.well-known/openid-configuration

Perfect, thanks. I’ve added a note to the OP

안녕하세요, OP(질문자)와 매우 유사한 문제를 겪고 있습니다. 저는 NHS.net에 인증을 시도하고 있는데, 이 서비스는 내부적으로 Active Directory를 기반으로 하며 아마도 Azure에서 제공되는 것 같습니다. OIDC 플러그인을 사용 중이며 다음과 같은 오류가 발생합니다:

(oidc) Authentication failure! invalid_credentials: OAuth2::Error,
(참고: OP의 오류와 달리 이 오류는 쉼표로 끝나고 추가 데이터가 없습니다.)

인가(authorization) 및 토큰 스코프 설정을 openid email profile으로 변경해 보았습니다(구성 URL 데이터에 따르면 OIDC 엔드포인트에서 이러한 항목이 지원된다고 합니다).

하지만 여전히 UI에서 '죄송합니다. 계정 인가 중 오류가 발생했습니다. 다시 시도해 주세요.'라는 동일한 오류가 나타납니다.

JWT에서 데이터를 반환받지 못하는 것 같습니다. 따라서 ‘이메일 필드 누락’ 문제와는 정확히 동일하지는 않지만, 동일한 오류로 시작되었습니다. 메타(Meta)에서 이 오류(관련되어 보이는)를 찾을 수 있는 다른 유일한 곳은 SSL Error during OAuth2 입니다. 그 문제는 SSL 관련 문제로 밝혀졌고(재미있게도 NHS.net의 인증서에도 해당 문제가 있으며, 이를 보고했습니다). SSL 우회 조치를 설치한 후 Faraday SSL 오류는 사라졌습니다. 하지만 여전히 OpenID Connect 플로우의 일부가 깨져 있는 것으로 보입니다.

이 문제를 디버깅하기 위한 다음 단계에 대한 조언이 있을까요?