argoproj / argoproj/argo-workflows

Auth0 sso integration makes `customGroupClaimName` and `userInfoPath` conflict

Open
#9,786 3 comments 1 reaction 0 assignees View on GitHub
area/sso-rbac P3
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

### Pre-requisites

- [X] I have double-checked my configuration
- [X] I can confirm the issues exists when I tested with `:latest`
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/master/docs/CONTRIBUTING.md))

### What happened/what you expected to happen?

Auth0 forbid Groups claim. There is an extension can be used to add custom claims to the issued token.

https://auth0.com/docs/customize/extensions/authorization-extension/use-rules-with-the-authorization-extension#add-custom-claims-to-the-issued-token

And Auth0 also require to call /userinfo to get attributes like email, custom claims.

https://auth0.com/docs/api/authentication#get-user-info

These lead to customGroupClaimName and userInfoPath both need to be set in argo-workflow helm chart.
func HandleCallback(from server/auth/sso/sso.go) will make groups always be nil.

### Version

3.4.1 helm chart 0.20.1

```go

// Default to groups claim but if customClaimName is set
// extract groups based on that claim key
groups := c.Groups
if s.customClaimName != "" {
groups, err = c.GetCustomGroup(s.customClaimName)
if err != nil {
w.WriteHeader(401)
return
}
}

// Some SSO implementations (Okta) require a call to
// the OIDC user info path to get attributes like groups
if s.userInfoPath != "" {
groups, err = c.GetUserInfoGroups(oauth2Token.AccessToken, s.issuer, s.userInfoPath)
if err != nil {
w.WriteHeader(401)
return
}
}

```

Contributor guide

Open the contributing guide

Research direction

Start in server/auth/sso/sso.go at HandleCallback and inspect how GetCustomGroup and GetUserInfoGroups populate groups. Reproduce the configuration with both customGroupClaimName and userInfoPath enabled, then verify that the callback does not overwrite valid groups with nil and returns the expected authenticated result.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.