GitLab OpenID id_token缺少用户个人资料声明

时间:2018-03-19 14:27:08

标签: oauth gitlab openid claims

我正在尝试使用GitLab(自托管CE版)作为OpenID身份验证提供程序。我正在关注https://docs.gitlab.com/ee/integration/openid_connect_provider.html#enabling-openid-connect-for-oauth-applicationshttps://docs.gitlab.com/ce/api/oauth2.html#gitlab-as-an-oauth2-provider以手动验证流程。

我创建了GitLab应用程序以生成客户端ID&秘密。我也可以通过点击https://gitlab.example.com/oauth/authorize?client_id=APP_ID&redirect_uri=REDIRECT_URI&response_type=code&state=YOUR_UNIQUE_STATE_HASH&scope=openid

来成功获得授权码

我也可以通过调用https://gitlab.example.com/oauth/token?client_id=ID&client_secret=SECRET&code=CODE&grant_type=authorization_code&redirect_uri=http://localhost

上的POST来检索id_token(JWT)

但是当我解码jw​​t.io上的id_token时,我无法看到文档链接中提到的所有用户个人资料声明。以下是我获得的JWT Payload示例

{
  "iss": "https://gitlab.example.com",
  "sub": "768d4eeae122ca6655c9127487d9c4cd85b079796d35d33753b3c15b93486044",
  "aud": "c3be56f955c74f0601683654df61ed3f74774902e2fb6da7ce05415b8a30e1d7",
  "exp": 1521463699,
  "iat": 1521463579,
  "auth_time": 1521456265
}

任何人都可以请求帮助我如何在claims中获取各种用户个人资料属性,例如电子邮件,姓名等。

我正在使用GitLab Community Edition 10.5.0 34d5766

0 个答案:

没有答案