-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
re-construct OIDC config and flatten keycloak groups #1934
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
890d6e7
re-construct oidc config
IamTaoChen 51a257b
change var name
IamTaoChen 77c6bca
update example
IamTaoChen bd78f56
fix bug
IamTaoChen 1e128fc
username=email
IamTaoChen d211b93
fix spell error: allowd -> allowed
IamTaoChen 901613a
Merge branch 'main' into dev_oidc
IamTaoChen 39b34ad
update oidc README.md
IamTaoChen 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -272,10 +272,10 @@ dns_config: | |
| unix_socket: /var/run/headscale/headscale.sock | ||
| unix_socket_permission: "0770" | ||
| # | ||
| # headscale supports experimental OpenID connect support, | ||
| # it is still being tested and might have some bugs, please | ||
| # help us test it. | ||
| # OpenID Connect | ||
| # # headscale supports experimental OpenID connect support, | ||
| # # it is still being tested and might have some bugs, please | ||
| # # help us test it. | ||
| # # OpenID Connect | ||
| # oidc: | ||
| # only_start_if_oidc_is_available: true | ||
| # issuer: "https://your-oidc.issuer.com/path" | ||
|
|
@@ -284,44 +284,60 @@ unix_socket_permission: "0770" | |
| # # Alternatively, set `client_secret_path` to read the secret from the file. | ||
| # # It resolves environment variables, making integration to systemd's | ||
| # # `LoadCredential` straightforward: | ||
| # client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret" | ||
| # # client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret" | ||
| # # client_secret and client_secret_path are mutually exclusive. | ||
| # | ||
| # # The amount of time from a node is authenticated with OpenID until it | ||
| # # expires and needs to reauthenticate. | ||
| # # Setting the value to "0" will mean no expiry. | ||
| # expiry: 180d | ||
| # | ||
| # # Use the expiry from the token received from OpenID when the user logged | ||
| # # in, this will typically lead to frequent need to reauthenticate and should | ||
| # # only been enabled if you know what you are doing. | ||
| # # Note: enabling this will cause `oidc.expiry` to be ignored. | ||
| # use_expiry_from_token: false | ||
| # | ||
| # # | ||
| # # Customize the scopes used in the OIDC flow, defaults to "openid", "profile" and "email" and add custom query | ||
| # # parameters to the Authorize Endpoint request. Scopes default to "openid", "profile" and "email". | ||
| # | ||
| # scope: ["openid", "profile", "email", "custom"] | ||
| # extra_params: | ||
| # domain_hint: example.com | ||
| # | ||
| # # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the | ||
| # # authentication request will be rejected. | ||
| # | ||
| # allowed_domains: | ||
| # - example.com | ||
| # # Note: Groups from keycloak have a leading '/' | ||
| # allowed_groups: | ||
| # - /headscale | ||
| # allowed_users: | ||
| # - [email protected] | ||
| # | ||
| # # If `strip_email_domain` is set to `true`, the domain part of the username email address will be removed. | ||
| # # This will transform `[email protected]` to the user `first-name.last-name` | ||
| # # If `strip_email_domain` is set to `false` the domain part will NOT be removed resulting to the following | ||
| # user: `first-name.last-name.example.com` | ||
| # | ||
| # strip_email_domain: true | ||
| # # extra_params: | ||
| # # domain_hint: example.com | ||
|
|
||
| # expiry: | ||
| # # | ||
| # # Use the expiry from the token received from OpenID when the user logged | ||
| # # in, this will typically lead to frequent need to reauthenticate and should | ||
| # # only been enabled if you know what you are doing. | ||
| # # Note: enabling this will cause `oidc.expiry.fixed_time` to be ignored. | ||
| # from_token: false | ||
| # # | ||
| # # The amount of time from a node is authenticated with OpenID until it | ||
| # # expires and needs to reauthenticate. | ||
| # # Setting the value to "0" will mean no expiry. | ||
| # fixed_time: 180d | ||
|
|
||
| # # # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the | ||
| # # # authentication request will be rejected. | ||
| # # allowd: | ||
| # # domains: | ||
| # # - example.com | ||
| # # groups: | ||
| # # - admins | ||
| # # users: | ||
| # # - [email protected] | ||
|
|
||
| # # Map claims from the OIDC token to the user object | ||
| # claims_map: | ||
| # name: name | ||
| # username: email | ||
| # # username: preferred_username | ||
| # email: email | ||
| # groups: groups | ||
|
|
||
|
|
||
| # # some random configuration | ||
| # misc: | ||
| # # if the username is set to `email` then `strip_email_domain` is valid | ||
| # # If `strip_email_domain` is set to `true`, the domain part of the username email address will be removed. | ||
| # # This will transform `[email protected]` to the user `first-name.last-name` | ||
| # # If `strip_email_domain` is set to `false` the domain part will NOT be removed resulting to the following | ||
| # # user: `first-name.last-name.example.com` | ||
| # strip_email_domain: true | ||
| # # If `flatten_groups` is set to `true`, the groups claim will be flattened to a single level. | ||
| # # this is used for keycloak where the groups are nested. the groups format from keycloak is `group1/subgroup1/subgroup2` | ||
| # flatten_groups: true | ||
| # # If `flatten_splitter` is set to a string, the groups claim will be split by the string and flattened to a single level. | ||
| # flatten_splitter: "/" | ||
|
|
||
| # Logtail configuration | ||
| # Logtail is Tailscales logging and auditing infrastructure, it allows the control panel | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.