feat: add per-client and connector-level(LDAP) allowedGroups#4592
Open
DoMaLo wants to merge 1 commit intodexidp:masterfrom
Open
feat: add per-client and connector-level(LDAP) allowedGroups#4592DoMaLo wants to merge 1 commit intodexidp:masterfrom
DoMaLo wants to merge 1 commit intodexidp:masterfrom
Conversation
Signed-off-by: Dmitiy Gushchin <dmitrijgushhin@yandex.ru>
Member
|
Hello, and thank you for the PR.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR adds per-client and connector-level group restrictions so that only users in configured groups can complete SSO for a given OAuth2 client or connector.
allowedGroups: Optional list of groups on each OAuth2 client (storage + static config). Only users in at least one of these groups can complete login for that client. One connector can serve many clients; each client can have its own list.allowedGroups: Same pattern as existing OIDC/SAML connectors: optionalallowedGroupsin LDAP connector config; only users in those groups can log in through that connector.allowedGroups, Dex adds thegroupsscope for the connector call (so groups are available for the check) but does not add it to the auth request scopes, so the issued token does not contain agroupsclaim unless the client requested thegroupsscope.All storage backends (memory, Kubernetes, SQL, ent), gRPC API (CreateClient/GetClient/ListClients), and static config are updated. Backward compatible: empty or missing
allowedGroupsmeans no restriction.What this PR does / why we need it
allowedGroupsallows mandating that only users in certain groups can log in; if group search returns no groups or the user is not in the allowed list, login fails with 403.allowedGroups; this PR adds the same to LDAP and introduces a per-client restriction so that different applications (clients) can require different groups without separate connectors.allowedGroupslets each client restrict access to its intended set of groups. Works with Kubernetes storage (OAuth2Client CRD) and static config.Special notes for your reviewer
pkg/groupsFilter. LDAP TestAllowedGroups exists (skipped whenDEX_LDAP_HOSTis not set).