Tailscale
This guide explains how to set up single sign-on (SSO) between SmartLink and Tailscale using OpenID Connect with WebFinger for simplified configuration.
Prerequisites
- Tailscale account with a plan supporting custom SSO (Business or Enterprise)
- Administrative access to Tailscale
- Domain verified in Tailscale
- Application configured in SmartLink with OpenID Connect
- WebFinger configured on SmartLink (optional but recommended)
Overview
Tailscale supports SSO authentication via OpenID Connect with a unique feature: WebFinger. This allows users to simply log in with their email address without needing to know the provider's URL.
Configuration in SmartLink
1. Create the application
- Log in to SmartLink as an administrator
- Go to Applications → Add
- Create a new application:
- Name: Tailscale
- URL:
https://login.tailscale.com - Description: VPN Mesh Tailscale
- Icon: Choose or upload the Tailscale icon
2. Configure OpenID Connect
- In the Authentication tab
- Select OpenID Connect as the authentication type
- Configure the parameters:
- Client ID:
tailscale-xxxxxx(will be generated automatically) - Client Secret:
secret-xxxxxx(will be generated automatically) - App ID:
[appid](unique identifier of the application in SmartLink) - Client Type: Confidential
- Client ID:
3. Configure Redirect URLs
Add the following URLs to Allowed Redirect URLs:
https://login.tailscale.com/a/oauth_response
https://controlplane.tailscale.com/a/oauth_response
4. Configure Scopes and Claims
Required scopes:
openidprofileemail
Additional claims (optional):
groups: To map SmartLink groups to Tailscale ACLspicture: For user avatar
5. WebFinger Configuration (Recommended)
WebFinger allows users to log in with their email instead of the full provider URL.
Verify WebFinger Configuration
Your domain (not your SmartLink) should automatically expose WebFinger at:
https://<yourdomain>/.well-known/webfinger
Test with:
curl "https://example.com/.well-known/webfinger"
The response should contain:
{
"subject": "acct:user@example.com",
"links": [
{
"rel": "http://openid.net/specs/connect/1.0/issuer",
"href": "https://your-smartlink.link.vaultys.org/api/oidc/[appid]"
}
]
}
Configuration in Tailscale
1. Access SSO Settings
- Log in to Tailscale Admin Console
- Go to Settings → Identity provider
- Click on Configure custom OIDC
2. Configure OpenID Connect Provider
Fill in the following fields:
- Issuer URL:
https://your-smartlink.link.vaultys.org - Client ID:
[Copy from SmartLink] - Client Secret:
[Copy from SmartLink]
Note: The application created in SmartLink automatically generates an
[appid]which will be used in the endpoint URLs.
3. Endpoint Configuration (if not auto-discovered)
If Tailscale does not automatically detect the endpoints via .well-known/openid-configuration, configure manually:
- Configuration URL:
https://your-smartlink.link.vaultys.org/api/oidc/[appid]/.well-known/openid-configuration - Authorization endpoint:
https://your-smartlink.link.vaultys.org/api/oidc/[appid]/authorize - Token endpoint:
https://your-smartlink.link.vaultys.org/api/oidc/[appid]/token - UserInfo endpoint:
https://your-smartlink.link.vaultys.org/api/oidc/[appid]/userinfo - JWKS endpoint:
https://your-smartlink.link.vaultys.org/api/oidc/[appid]/jwks
4. Attribute Mapping
User mapping configuration:
- Email claim:
email - Name claim:
nameoremail - Groups claim:
groups(if using group-based ACLs)
5. Domain Configuration
In Email domain requirements:
- Add your email domain:
@example.com - Enable Allow only verified domains
WebFinger Configuration for Simplified Login
Advantages of WebFinger
With WebFinger configured, users can log in using just:
user@example.com
Instead of:
https://your-smartlink.link.vaultys.org
DNS Configuration for WebFinger
If your email domain is different from the SmartLink domain, add a redirection:
- Create a CNAME or A record for
webfinger.example.com - Configure your web server to redirect:
location /.well-known/webfinger {
return 307 https://your-smartlink.link.vaultys.org/.well-known/webfinger$is_args$args;
}
Test WebFinger with Tailscale
- On the Tailscale login page
- Enter your email:
user@example.com - Tailscale should automatically discover SmartLink as the provider
- You will be redirected to SmartLink for authentication
Group-Based ACL Configuration
1. Enable Groups in SmartLink
- In the Tailscale application on SmartLink
- Ensure the
groupsscope is enabled - Verify that groups are returned in the claims
2. Configure Tailscale ACLs
Example ACL configuration in Tailscale:
{
"groups": {
"group:admin": ["user@example.com"],
"group:dev": ["tag:dev-servers"]
},
"acls": [
{
"action": "accept",
"src": ["group:admin"],
"dst": ["*:*"]
},
{
"action": "accept",
"src": ["group:dev"],
"dst": ["tag:dev-servers:*"]
}
],
"tagOwners": {
"tag:dev-servers": ["group:admin"]
}
}
3. Automatic Group Synchronization
If configured correctly, SmartLink groups will be mapped to Tailscale:
- SmartLink group
developers→group:developersin Tailscale - SmartLink group
admins→group:adminsin Tailscale
Configuration Testing
1. Initial Connection Test
- Log out of Tailscale
- Go to login.tailscale.com
- Enter your corporate email
- You should be redirected to SmartLink
- Authenticate with your SmartLink credentials
- You should be connected to Tailscale
2. Test with Tailscale Client
- Install the Tailscale client on your device
- Click on Log in
- Use your corporate email
- The client should open a browser to SmartLink
- After authentication, the client should connect
3. Permission Verification
# Check connection status
tailscale status
# Check applied ACLs
tailscale netcheck
# Check tags and groups
tailscale debug acls
Troubleshooting
"Invalid issuer" Error
Issue: Tailscale does not recognize the SmartLink issuer
Solution:
- Verify that the issuer URL is exactly:
https://your-smartlink.link.vaultys.org - Test OpenID discovery with your appid:
curl https://your-smartlink.link.vaultys.org/api/oidc/[appid]/.well-known/openid-configuration - Ensure the issuer in the configuration matches the returned one
WebFinger Not Working
Issue: Simple email login is not working
Solution:
- Test WebFinger directly:
curl "https://your-smartlink.link.vaultys.org/.well-known/webfinger?resource=acct:test@example.com" - If your email domain is different, configure DNS redirection
- Check CORS headers if necessary
"User not authorized" Error
Issue: User cannot access Tailscale after authentication
Solution:
- Verify that the user's email matches the configured domain
- Ensure the user is assigned to the application in SmartLink
- Check Tailscale Admin Console logs
Groups Not Synchronized
Issue: Group-based ACLs are not working
Solution:
- Verify that the
groupsscope is enabled - Test the UserInfo endpoint to see groups:
curl -H "Authorization: Bearer TOKEN" https://your-smartlink.link.vaultys.org/api/oidc/[appid]/userinfo - Check the format of the returned groups (array of strings)
- Adjust Tailscale ACLs to match the groups format
SSL Certificate Error
Issue: SSL validation error during connection
Solution:
- Ensure you are using a valid SSL certificate (not self-signed)
- Check the full certificate chain
- Test with:
openssl s_client -connect your-smartlink.example.com:443 -showcerts
Security
Best Practices
- Mandatory HTTPS: Never use HTTP for OAuth endpoints
- Verified Domains: Limit access to verified email domains
- Secret Rotation: Regularly change the Client Secret
- Strict ACLs: Use the principle of least privilege
- Audit Logs: Monitor connections in Tailscale Admin
MFA Configuration
Tailscale inherits MFA configuration from SmartLink:
- Enable MFA in SmartLink for users
- Users will need to authenticate with MFA when logging into Tailscale
Access Revocation
To revoke a user's access:
- Disable or delete the user in SmartLink
- Tailscale access will be automatically revoked upon token expiration
- For immediate revocation, also delete the device in Tailscale Admin
Advanced Configuration
Custom Session Expiration
In SmartLink, configure token lifetimes:
- Access Token: 1 hour (recommended)
- Refresh Token: 30 days
- Tailscale Session: Aligns with the Refresh Token
Integration with Headscale
If you are using Headscale (open-source control server):
- Follow the Headscale guide
- OpenID configuration is similar
- WebFinger also works with Headscale
Automation with Terraform
Example Terraform configuration for Tailscale:
resource "tailscale_acl" "main" {
acl = jsonencode({
groups = {
"group:admin" = ["user@example.com"]
}
acls = [
{
action = "accept"
src = ["group:admin"]
dst = ["*:*"]
}
]
})
}