The SSO Client module transparently proxies user authentication and profile operations to an SSO server when anchored, while evaluating permissions locally using the client instance's own group and context definitions.
This module provides seamless centralized authentication with local authorization. User identity operations (login, registration, profile updates) are proxied to the SSO server, while Doh.permit() checks run entirely on the local instance against locally-defined permission groups and contexts.
Configure SSO Client in your pod.yaml:
sso_client:
endpoint: "https://your-sso-server.com"
fallback_to_local: true
debug_logging: false
| Option | Type | Default | Description |
|---|---|---|---|
endpoint |
String | null |
SSO server URL |
token_storage_path |
String | /.doh/static/sso_auth_token |
Path for auth token storage |
anchor_path |
String | /.doh/static/sso-anchor.json |
Path for anchor data storage |
connection_timeout |
Number | 30000 |
Connection timeout in milliseconds |
reconnect_interval |
Number | 5000 |
Reconnection interval in milliseconds |
heartbeat_interval |
Number | 60000 |
Heartbeat interval in milliseconds |
fallback_to_local |
Boolean | true |
Fallback to local users if SSO unavailable |
debug_logging |
Boolean | false |
Enable debug logging |
The module provides a complete CLI interface mirroring cloud anchoring patterns:
# Set SSO endpoint
doh sso endpoint <sso-server-url>
# Anchor to SSO server with your credentials
doh sso anchor
# Set endpoint and anchor in one command
doh sso anchor <sso-server-url>
# Anchor on behalf of another user (requires permissions)
doh sso anchor-as <user@sso-server.com>
# Show anchoring status
doh sso status
# Clear anchoring (revert to local users)
doh sso clear
# Show available commands
doh sso
# Configure and anchor to SSO server
doh sso endpoint https://sso.company.com
doh sso anchor
# Check status
doh sso status
# Clear anchoring if needed
doh sso clear
When anchored, the following user operations are transparently proxied:
Users.authenticateUser() → SSO server authenticationUsers.getUserByUsername() → SSO server user lookupUsers.createUser() → SSO server user creationUsers.updateUser() → SSO server user updatesUsers.deleteUser() → SSO server user deletionUsers.getAllUsers() → SSO server user listingDoh.permit() → Evaluated locally using the client's own Doh.PermissionGroups and Doh.PermissionContextsDoh.loadUserPermissionGroups() runs locally to populate groups from local definitionsgroups — they are always computed on the clientWhen fallback_to_local is enabled (default), the client will:
This ensures resilience and allows graceful degradation.
The SSO Client implements a sophisticated multi-level caching system to optimize performance:
// Programmatic cache control
Doh.SSOAnchoring.clearUserCache(); // Clear user data cache
Doh.SSOAnchoring.refreshUserCache(user); // Refresh specific user
Cache is automatically managed but can be controlled when needed.
Access the admin interface at /admin/sso_anchoring to:
The interface uses the admin dashboard theme and provides the same core functionality as the CLI.
The module defines the following permission group:
sso_user GroupPermissions:
manage:sso_anchoring - Can anchor/unanchor instancesview:sso_anchoring - Can view SSO connection interfaceTo assign SSO user permissions:
// Via code
Doh.assignUserToPermissionGroup(user, 'sso_user');
Or via pod configuration:
Users:
groups:
sso_user:
inherits: ['authenticated_user']
permissions:
- 'manage:sso_anchoring'
- 'view:sso_anchoring'
This module enables "cold" instance deployment:
doh sso anchor https://sso.company.comNo user migration, database setup, or configuration required!
Organization Setup:
Benefits:
The module provides comprehensive error handling and diagnostic capabilities:
"Endpoint not supported via socket" Error
/api/sso/user/profile/ endpointExcessive Validation Calls
"Cannot read properties of undefined (reading 'replace')" Error
Enable comprehensive debugging in pod.yaml:
sso_client:
debug_logging: true
browser_pod:
Users:
auth_debug: true # Enable authentication debug messages
Network Errors
Authentication Errors
Configuration Errors
The module includes automatic recovery mechanisms:
The module exposes functions via Doh.SSOAnchoring:
Anchoring
performSSOAnchoring(username, password) - Anchor to SSO serverperformSSOAnchoringAs(requestingUser, requestingPassword, targetUser) - Anchor-asisInstanceSSOAnchored() - Check if anchoredclearSSOAuthToken() - Clear authentication tokenclearSSOAnchor() - Clear anchor dataAnchor Data
loadSSOAnchor() - Load stored anchor data (fingerprint, created, lastUsed)storeSSOAnchor(fingerprint, originalFingerprint?) - Store anchor datagetSSOFingerprint() - Get instance fingerprintCache Management
clearUserCache() - Clear all cached user datarefreshUserCache(user) - Refresh cache for a specific userConnection
getConnectionStatus() - Returns current connection state ('connected', 'disconnected', 'unknown')These functions are used by the CLI and admin interface but can also be called programmatically.