diff --git a/development/ref/oidc/index.html b/development/ref/oidc/index.html index 3df38c1a..336dd4ee 100644 --- a/development/ref/oidc/index.html +++ b/development/ref/oidc/index.html @@ -39,4 +39,6 @@ client_secret: "generated-secret" use_expiry_from_token: true
Expire a node and force re-authentication
A node can be expired immediately via:
You may refer to users in the Headscale policy via:
A user identifier in the policy must contain a single @
The Headscale policy requires a single @ to reference a user. If the username or provider identifier doesn't already contain a single @, it needs to be appended at the end. For example: the username ssmith has to be written as ssmith@ to be correctly identified as user within the policy.
Email address or username might be updated by users
Many identity providers allow users to update their own profile. Depending on the identity provider and its configuration, the values for username or email address might change over time. This might have unexpected consequences for Headscale where a policy might no longer work or a user might obtain more access by hijacking an existing username or email address.
Headscale uses the standard OIDC claims to populate and update its local user profile on each login. OIDC claims are read from the ID Token and from the UserInfo endpoint.
| Headscale profile | OIDC claim | Notes / examples |
|---|---|---|
| email address | email | Only used when email_verified: true |
| display name | name | eg: Sam Smith |
| username | preferred_username | Depends on identity provider, eg: ssmith, ssmith@idp.example.com, \\example.com\ssmith |
| profile picture | picture | URL to a profile picture or avatar |
| provider identifier | iss, sub | A stable and unique identifier for a user, typically a combination of iss and sub OIDC claims |
groups | Only used to filter for allowed groups |
@.email_verified: true).Please see the GitHub label "OIDC" for OIDC related issues.
Third-party software and services
This section of the documentation is specific for third-party software and services. We recommend users read the third-party documentation on how to configure and integrate an OIDC client. Please see the Configuration section for a description of Headscale's OIDC related configuration settings.
Any identity provider with OpenID Connect support should "just work" with Headscale. The following identity providers are known to work:
Authelia is fully supported by Headscale.
Encryption Key in the providers section unset.No username due to missing preferred_username
Google OAuth does not send the preferred_username claim when the scope profile is requested. The username in Headscale will be blank/not set.
In order to integrate Headscale with Google, you'll need to have a Google Cloud Console account.
Google OAuth has a verification process if you need to have users authenticate who are outside of your domain. If you only need to authenticate users from your domain name (ie @example.com), you don't need to go through the verification process.
However if you don't have a domain, or need to add users outside of your domain, you can manually add emails via Google Console.
APIs and services -> CredentialsCreate Credentials -> OAuth client IDApplication Type, choose Web ApplicationName, enter whatever you likeAuthorised redirect URIs, add Headscale's OIDC callback URL: https://headscale.example.com/oidc/callbackSave at the bottom of the formClient ID and Client secret, you can also download it for reference if you need it.https://accounts.google.com.headscale_users@sso.example.com.Keycloak is fully supported by Headscale.
Keycloak has no built-in client scope for the OIDC groups claim. This extra configuration step is only needed if you need to authorize access based on group membership.
groups for OpenID Connect:Group Membership mapper with name groups and the token claim name groups.group.Default.Full group path option:Full group path is enabled: groups contain their full path, e.g. /top/group1Full group path is disabled: only the name of the group is used, e.g. group1In order to integrate Headscale with Microsoft Entra ID, you'll need to provision an App Registration with the correct scopes and redirect URI.
Configure Headscale following the "Basic configuration" steps. The issuer URL for Microsoft Entra ID is: https://login.microsoftonline.com/<tenant-UUID>/v2.0. The following extra_params might be useful:
domain_hint: example.com to use your own domainprompt: select_account to force an account picker during loginGroups for the allowed groups filter need to be specified with their group ID instead of the group name.