Skip to content

Commit e553d87

Browse files
committed
chore: add warning log if misconfigured groups oidc
This is not perfect, but if we find a 'groups' claim and it is not configured, put out a warning log to give some information
1 parent baa9922 commit e553d87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

coderd/userauth.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,12 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
675675
}
676676
}
677677

678+
// This conditional is purely to warn the user they might have misconfigured their OIDC
679+
// configuration.
680+
if _, groupClaimExists := claims["groups"]; !usingGroups && groupClaimExists {
681+
api.Logger.Warn(ctx, "'groups' claim was returned, but 'oidc-group-field' is not set, check your coder oidc settings.")
682+
}
683+
678684
// The username is a required property in Coder. We make a best-effort
679685
// attempt at using what the claims provide, but if that fails we will
680686
// generate a random username.

0 commit comments

Comments
 (0)