No email field in HUB REST API response

Hello,

I'm trying to use JB Hub as oAuth2 identity provider for my standalone GitLab instance. I'm using the /api/rest/users/me endpoint to get current user's profile data authenticated via generated oauth token, and this works fine.

I get name, login and id parameters needed, however I'm unable to get the email parameter. I managed to get $.profile.email parameter, however this does not satisfy GitLab requirements, as it requires the email parameter to be at the same level as both name and login. Furthermore, I'm unable to find documentation for this endpoint so I'm looking in the dark a bit.

Is there a way to get the email parameter using this endpoint? Or is there any other endpoint that can provide me with all the required information? I was following this guide, but it seems a bit dated now and some things must have changed since it was released: http://lifeinide.com/post/2017-08-30-jetbrains-hub-as-oauth2-provider-for-gitlab/

Thanks

1 comment
Comment actions Permalink
Official comment

Hi!

I'm Sergey from the Youtrack team.

I've already replied to you via a support ticket but will post the answer here as well in case someone else will face a similar issue. 

___

Please try using <Hub URL>/api/rest/oauth2/userinfo instead. It returns both email and email verification status which should be what you are looking for.

Please sign in to leave a comment.