Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Custom Admin OIDC Groups #1121

Closed
dwmunster opened this issue Nov 22, 2022 · 3 comments
Closed

[feature] Custom Admin OIDC Groups #1121

dwmunster opened this issue Nov 22, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@dwmunster
Copy link

Is your feature request related to a problem ?

Currently, internal/api/client/auth/callbacks.go uses a hardcoded list of groups to determine if the user is an admin (namely "admin" and "admins"). For some IDPs, groups may be returned as more opaque identifiers, rather than human-friendly names. Therefore, such users are unable to be made admins without manual intervention.

Describe the solution you'd like.

The list of group names that are made admins should be configurable.

Describe alternatives you've considered.

None.

Additional context.

If this feature is of interest, I would be glad to contribute code implementing it.

@dwmunster dwmunster added the enhancement New feature or request label Nov 22, 2022
@tsmethurst
Copy link
Contributor

Thanks for opening this :)

We've got a few things open for OIDC at the moment which this fits in to, so I'm gonna link 'em here to help us keep track

#309 #961 #763

@decentral1se
Copy link
Contributor

I think this was solved in #961

// check if the user is in any recognised admin groups
adminGroups := config.GetOIDCAdminGroups()
var admin bool
LOOP:
for _, g := range claims.Groups {
for _, ag := range adminGroups {
if strings.EqualFold(g, ag) {
admin = true
break LOOP
}
}
}

# Array of string. If the returned ID token contains a 'groups' claim that matches one of the
# groups in oidc-admin-groups, then this user will be granted admin rights on the GtS instance
# Default: []
oidc-admin-groups: []

@tsmethurst
Copy link
Contributor

Ah yes, thanks! Will close this now then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants