Skip to content

OIDC Group claims will not remove users from groups if they belong to 0 groups #6545

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

Closed
Emyrk opened this issue Mar 10, 2023 · 1 comment · Fixed by #6546
Closed

OIDC Group claims will not remove users from groups if they belong to 0 groups #6545

Emyrk opened this issue Mar 10, 2023 · 1 comment · Fixed by #6546
Assignees
Labels
s1 Bugs that break core workflows. Only humans may set this.

Comments

@Emyrk
Copy link
Member

Emyrk commented Mar 10, 2023

The current logic sets the user's groups at their OIDC login. If the OIDC claim has 0 groups listed (AKA no groups), then nothing happens. We need to support removing someone from all groups.

coder/coderd/userauth.go

Lines 867 to 874 in 2abae42

// Ensure groups are correct.
if len(params.Groups) > 0 {
//nolint:gocritic
err := api.Options.SetUserGroups(dbauthz.AsSystemRestricted(ctx), tx, user.ID, params.Groups)
if err != nil {
return xerrors.Errorf("set user groups: %w", err)
}
}

@Emyrk
Copy link
Member Author

Emyrk commented Mar 10, 2023

Notes: In Okta, if you are in 0 groups, the groups claim is not sent.

@bpmct bpmct added the s1 Bugs that break core workflows. Only humans may set this. label Apr 27, 2023
@matifali matifali added the bug label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s1 Bugs that break core workflows. Only humans may set this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants