You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Problem Description
I'm using Argo CD integrates with Dex and I configure Dex to connect my GitLab. (config like the document Dex Connector - gitlab) I notice Dex can get the user's groups but cannot get the group role.
// userGroups queries the GitLab API for group membership.//// The HTTP passed client is expected to be constructed by the golang.org/x/oauth2 package,// which inserts a bearer token as part of the request.func (c*gitlabConnector) userGroups(ctx context.Context, client*http.Client) ([]string, error) {
// ...varuuserInfoiferr:=json.NewDecoder(resp.Body).Decode(&u); err!=nil {
returnnil, fmt.Errorf("failed to decode response: %v", err)
}
fori, group:=rangeu.Owner {
u.Owner[i] =group+":"+"owner"
}
fori, group:=rangeu.Maintainer {
u.Maintainer[i] =group+":"+"maintainer"
}
fori, group:=rangeu.Developer {
u.Developer[i] =group+":"+"developer"
}
u.Groups=append(u.Groups, u.Owner...)
u.Groups=append(u.Groups, u.Maintainer...)
u.Groups=append(u.Groups, u.Developer...)
returnu.Groups, nil
}
Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Preflight Checklist
Problem Description
I'm using Argo CD integrates with Dex and I configure Dex to connect my GitLab. (config like the document Dex Connector - gitlab) I notice Dex can get the user's groups but cannot get the group role.
GitLab provide 3 types role (Owner, Maintainer, Developer) by api
/oauth/userinfo
(GitLab as OpenID Connect identity provider)e.g.
Proposed Solution
Maybe add group like
[group]:[role]
if user get theOwner
,Maintainer
orDeveloper
rolee.g.
I'm not familiar with golang so I just offer my suggestion.
update gitlab.go#L258
userInfo
update gitlab.go#L266
userGroups
Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: