我正在尝试使用GitLab(自托管CE版)作为OpenID身份验证提供程序。我正在关注https://docs.gitlab.com/ee/integration/openid_connect_provider.html#enabling-openid-connect-for-oauth-applications和https://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
但是当我解码jwt.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