Skip to content

Handle non-standard groups claims #2184

Answered by blut
blut asked this question in Q&A
Discussion options

You must be logged in to vote

I've debugged the issue and found that groups are parsed as []interface{}, meaning that string lists are discarded completely.
( https://github.com/dexidp/dex/blob/master/connector/oidc/oidc.go#L325-L343 )

Current workaround is custom parsing:

        if !found {
            groupsClaim := claims[groupsKey]
            groupsStr, ok := groupsClaim.(string)
            if ok {
                for _, v := range strings.Split(groupsStr, "|") {
                    if v == "" {
                        continue
                    }
                    groups = append(groups, v)
                }
            }
        }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant