Skip to content

OAuth Provider - Add Org/Team membership to userinfo endpoint #16818

Closed
@bminer

Description

@bminer
  • Gitea version (or commit ref): 1.15.0
  • Git version: N/A
  • Operating system: Linux
  • Database (use [x]): N/A
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

When Gitea is acting as an OAuth provider, it would be nice if the /login/oauth/userinfo endpoint would return the orgs/teams to which a user is assigned if the "profile" scope is set. This would allow the client to parse this information and could possibly map it to a user group.

One implementation might add a new claim for each org, using the org name as the key for the claim. The claim would be an array of team names to which the user belonged for that org.

Another implementation would be to add a "teams" claim containing an array of [org_name]:[team_name] strings (where the org name and team name are concatenated together, separated by a colon or dash).

Thoughts on this? I am willing to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions