OpenID Connect User Info missing email claim

I have asked this on ServerFault as well: https://serverfault.com/questions/943424/gitlab-openid-connect-provider-user-info-missing-email-claim

I’m not familiar with OAuth or OpenID Connect.

I’m having trouble using GitLab as OpenID Connect provider. The /oauth/userinfo request does not contain the email claim, unlike what is described here: https://docs.gitlab.com/ee/integration/openid_connect_provider.html

Here is the JSON of /oauth/userinfo:

{
    "sub": "1",
    "sub_legacy": "28a9efb797d1fe9a75de87788772b5cbca9ea7e9dc5d00728c8f0a9f0785f97a",
    "name": "Administrator",
    "nickname": "root",
    "profile": "http://gitlab.xxxxxxx.com/root",
    "picture": "xxxxxx",
    "groups": []
}

Am I missing any configurations? Where are the rest of the claims?

Oh, I just found out that the GitLab user must set their public email to something, before the email claim appears.

Well, I guess it’s hard to use GitLab provided email as my new username then…