generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 4
feat(dex): add option to modify userid claim, skip email_verified verification #1569
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
Open
kengou
wants to merge
7
commits into
main
Choose a base branch
from
feat/dex-orgconfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
125fb34
feat(dex): add option to modify user id claim, skip email_verified viβ¦
kengou 4874534
fix(api): fix default values
kengou f7b847a
update org sample
kengou d2320e3
fix org sample
kengou a7ae42c
Merge branch 'main' into feat/dex-orgconfig
kengou 7a52ae1
introduce ExtraConfig
kengou da900f0
Automatic generation of CRD API Docs
cloud-operator-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this option.
since dex in greenhouse is used for k8s auth⦠in structured authentication when using expression claims.email it implicitly needs claims.email_verified to be true
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right, but when an OIDC provider returns
emailclaim without "email_verified" field, this is assumed to be false by Dex, and newly generated claim is withemail_verified=false.Some enterprise providers return claims without
email_verified, when they had no usage of emails verification in enrollement process. Like Okta, CloudFoundry, EntraID.Kubernetes changed it's original behavior in this PR: kubernetes/kubernetes#61508 to set
email_verified=trueif the claim is not present, but on Dex side the PR is still open, and original behavior remained: dexidp/dex#3811Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR you referenced for k8s is for the legacy OIDC config and not for the structured auth anymore.
In structured auth when using
claims.expression(and not claimMappings)email_verifiedis required.https://github.com/kubernetes/kubernetes/blob/3daf280c464c712f38fe2a24d9434fcf2670c251/staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go#L417-L420
But Okta and EntraID (https://learn.microsoft.com/en-us/entra/external-id/customers/reference-oidc-claims-mapping-customers#claim-and-attribute-mappings) have the
email_verfiedclaim and in Okta there should be a toggle to turn it on for each user.The verification is anyway part of the enrollment process during sign-up. If users are added programmatically then the
email_verifiedcan also be set during that process.Also when dex config changes with new properties being introduced, the sig alg may change and there will be auth issues.
Here is what I would propose -
move
InsecureSkipEmailVerifiedandUserIDClaimto eithermap[string]stringor a*struct(for easy nil checks)That way no config changes are introduced on the existing connectors and only during enabling a new config these properties if available are considered.
sounds good?