Gitea: OAuth2 provider "userinfo" support

Created on 16 Oct 2019  路  10Comments  路  Source: go-gitea/gitea

Gitea has an OAuth2 provider that can be used to connect applications. ConcourseCI requires that Gitea has a "userinfo" endpoint though, which it currently does not provide. userinfo seems to be fairly simple (https://connect2id.com/products/server/docs/api/userinfo) and part of openid connect (there is a separate issue from someone else to provide that)/

kinenhancement revieweconfirmed

Most helpful comment

@lafriks what's the status about this issue and referenced PRs? I was trying to integrate Gitea with Concourse CI but it seems that still the missing userinfo endpoint in the latest gitea release is a showstopper for a proper OAuth integration.

All 10 comments

I've been trying to set up vouch-proxy https://github.com/vouch/vouch-proxy/ to use Gitea as an OAuth2 provider ant it also seems to require the "userinfo" endpoint.

The same problem with Wekan, it also requires the "userinfo" endpoint.

In fact we have one https://gitea.com/api/swagger#/user/userGetCurrent , but It may not satisfied the standard.

In fact we have one https://gitea.com/api/swagger#/user/userGetCurrent , but It may not satisfied the standard.

Expected request/response:

>> GET /login/oauth/userinfo
Authorization: Basic <access_token>
Accept: application/json

<< HTTP/1.1 200 OK
Content-Type: application/json

{
    "sub": "248289761001",
    "name": "Jane Doe",
    "preferred_username": "j.doe",
    "email": "[email protected]",
    "picture": "http://example.com/janedoe/me.jpg"
}

sub = ?!?
name = user.full_name
preferred_username = user.username
email = user.email
picture = user.avatar_url

I made a draft PR ... feel free to look at ...

sub is short for "subject" and is supposed to be a unique identifier for the user account, not necessarily something human readable. You could use an internal database ID for example.

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

Keep it open.

@lafriks what's the status about this issue and referenced PRs? I was trying to integrate Gitea with Concourse CI but it seems that still the missing userinfo endpoint in the latest gitea release is a showstopper for a proper OAuth integration.

Was this page helpful?
0 / 5 - 0 ratings