Skip to content
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

Add support for a list of groups represented as maps in OAuth. #23

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

vladsf
Copy link

@vladsf vladsf commented Oct 26, 2021

Hi,

Overview

I read about DCO, etc. I am not familiar with Golang yet, so I have created a draft PR to discuss
the problem which the fix outlines and possibly? solves before investing more time.

What this PR does / why we need it

OAuth supports providing user groups in userinfo token. Yet there are cases when groups are represented
as a list of maps, not strings e.g. "groups":[{"id":"1", "name":"gr1"},{"id": "2", "name":"gr2"}]. Current code
does not support that and ignores groups information.

Does this PR introduce a user-facing change?

NONE

There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

concourse#23

Signed-off-by: Vlad Safronov <[email protected]>
Signed-off-by: Vlad Safronov <[email protected]>
@vladsf vladsf marked this pull request as ready for review November 3, 2021 19:44
@vladsf
Copy link
Author

vladsf commented Nov 9, 2021

Hi @clarafu, would you please review the contribution?

@clarafu
Copy link

clarafu commented Nov 16, 2021

@vladsf Sorry for the delay, it looks good to me but I'm just going to quickly have @xtremerui confirm that this is okay for me since he has a lot more context on dex than myself!

Copy link

@xtremerui xtremerui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Just for user survey, what oauth provider are you using this connector with? We are thinking about switching back to upstream dex that doesn't support oauth connector yet. Would you be able to use OIDC connector instead? Thx!

@vladsf
Copy link
Author

vladsf commented Nov 16, 2021

Just for user survey, what oauth provider are you using this connector with? We are thinking about switching back to upstream dex that doesn't support oauth connector yet. Would you be able to use OIDC connector instead? Thx!

Thank you @clarafu. I am using Oracle Identity Cloud Service as oauth provider. I see. I have not tested OIDC yet, but I hope to try it in a few days. Did you consider submitting this OAuth connector to the upstream?

@xtremerui
Copy link

Did you consider submitting this OAuth connector to the upstream?

Already did it a long time ago, however it is still pending there for some reason. dexidp#1630

@vladsf
Copy link
Author

vladsf commented Nov 17, 2021

Would you be able to use OIDC connector instead?

@clarafu I tried and failed. skipIssuerValidation and InsecureIssuerURLContext are not supported in the mainstream OIDC connector. So it fails with failed to get provider: oidc: issuer did not match the issuer returned by provider, expected xxx.example.com got example.com in my stage environment. I could be wrong though and misunderstood oidc logic.

@xtremerui xtremerui merged commit 7309fa2 into concourse:master Nov 17, 2021
xtremerui pushed a commit that referenced this pull request Nov 17, 2021
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

#23

Signed-off-by: Vlad Safronov <[email protected]>
xtremerui pushed a commit that referenced this pull request Feb 8, 2022
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

#23

Signed-off-by: Vlad Safronov <[email protected]>
xtremerui pushed a commit that referenced this pull request Feb 8, 2022
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

#23

Signed-off-by: Vlad Safronov <[email protected]>
aelkiss pushed a commit to hathitrust/dex-shib-proxy that referenced this pull request May 4, 2022
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

concourse#23

Signed-off-by: Vlad Safronov <[email protected]>
elffjs pushed a commit to DIMO-Network/dex that referenced this pull request Jun 27, 2022
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

concourse#23

Signed-off-by: Vlad Safronov <[email protected]>
bobsongplus pushed a commit to bobsongplus/dex that referenced this pull request Jan 13, 2023
There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

concourse#23

Signed-off-by: Vlad Safronov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants