Repository navigation
Add Wildcard Subdomain Matching Support for Organization Domains #45190
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
Merged
Merged
Changes from all commits
Commits
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
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
68 changes: 68 additions & 0 deletions
68
docs/documentation/server_admin/topics/organizations/managing-domains.adoc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| [id="managing-organization-domains_{context}"] | ||
|
|
||
| = Managing organization domains | ||
|
|
||
| The domain associated with an organization plays an important role in how | ||
| organization members authenticate to a realm and how their profiles are validated. | ||
|
|
||
| One of the key roles of a domain is to help to identify the organizations where a user is a member. By looking at their | ||
| email address, {project_name} will match a corresponding organization using the same domain and eventually change the | ||
| authentication flow based on the organization requirements. | ||
|
|
||
| The domain also allows organizations to enforce that users are not allowed to use a domain in their emails | ||
| other than those associated with an organization. This restriction is especially useful when users, and their identities, | ||
| are federated from identity providers associated with an organization and you want to force a specific email domain for their email addresses. | ||
|
|
||
| == Assigning domains | ||
|
|
||
| Domains are assigned through the *Domains* setting when creating or editing an organization. An organization can have | ||
| zero, one, or multiple domains. | ||
|
|
||
| When no domain is assigned, members are not validated against domain restrictions and email-based redirection to | ||
| identity providers is unavailable. | ||
|
|
||
| == Domain types | ||
|
|
||
| Exact:: | ||
| Matches only the specified value. `example.com` matches `user@example.com` but not `user@sub.example.com`. | ||
|
|
||
| Wildcard:: | ||
| Prefix the base domain with `*.` to match the base domain and all its subdomains at any depth. | ||
| `*.example.com` matches `user@example.com`, `user@sub.example.com`, and `user@deep.sub.example.com`. | ||
|
|
||
| == Mapping email addresses to organizations | ||
|
|
||
| {project_name} extracts the domain from the email address, normalizes it to lowercase, and selects the best-matching | ||
| organization using the following rules: | ||
|
|
||
| . Matching is case-insensitive. | ||
| . The most specific match wins, measured by the number of domain parts. For example, when resolving `user@deep.sub.example.com`: | ||
| * `deep.sub.example.com` (4 parts, exact) wins over `*.sub.example.com` (4 parts, wildcard) and `*.example.com` (3 parts, wildcard). | ||
| * `*.sub.example.com` (4 parts) wins over `*.example.com` (3 parts). | ||
| . When two domains have the same number of parts, an exact match wins over a wildcard. | ||
|
|
||
| The same rules determine which domain is reported in token claims such as the `domain` claim from the | ||
| organization membership mapper. | ||
|
|
||
| == Validation rules | ||
|
|
||
| * A domain cannot be shared across organizations in the same realm. | ||
| * Domains are stored and compared in lowercase. | ||
| * A domain must have at least 2 parts (e.g. `example.com`). Single-part domains such as `com`, `org`, or `*.com` are rejected. | ||
| * A domain cannot have more than 10 parts. | ||
| * The `*.` wildcard prefix may appear only once and only at the start of the value (e.g. `sub.*.example.com` is rejected). | ||
|
|
||
| == Considerations | ||
|
|
||
| Prefer the most specific value:: | ||
| Use an exact domain for a single, well-known address. Use a wildcard when new subdomains may appear over time and should | ||
| all map to the same organization. | ||
|
|
||
| Overlapping domains across organizations are allowed but resolved deterministically:: | ||
| An organization may own `*.example.com` while another owns `sub.example.com`. Only one organization is returned per lookup, | ||
| always the most specific match, with exact winning over wildcard at equal specificity. Verify the intended mapping | ||
| before relying on overlapping configurations. | ||
|
|
||
| Use exact domains to model exceptions:: | ||
| An organization can hold both `*.example.com` and `vip.example.com`. Addresses under `vip.example.com` resolve to the | ||
| exact entry; all other subdomains fall back to the wildcard. |
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
10BC8
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.
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.
Added a new option to allow setting a comma-separated list of domains to exclude from auto-redirect.