Workspace Sessions
Workspace Sessions provide a simple Single Sign-On (SSO) solution for users to seamlessly move between multiple apps within the same workspace without re-authentication.Use Cases
- Multi-app ecosystems: Users authenticated in your main app can access related tools/services
- Marketplace platforms: Vendors authenticated in the marketplace can access their seller dashboard
- Admin panels: Users can switch between customer-facing app and admin interface
- Microservices: Frontend can authenticate users across different backend services
How It Works
The workspace session flow exchanges a user’s existing session in one app for a new session in another app within the same workspace:Authentication Flow
- User is already authenticated in App A within your workspace
- Your backend calls the workspace session endpoint with:
- User’s access token (from App A)
- Workspace API key (from dashboard)
- Target app ID (App B)
- Receive new session tokens for the user in App B
- User is now authenticated in App B without manual login
Implementation
Prerequisites
- Multiple apps in the same workspace
- Workspace API key from your Scute dashboard
- User authenticated in source app
API Request
Response (Scute Session)
Example: Marketplace to Seller Dashboard
Security Considerations
Access Control
- Workspace API key ensures only authorized apps can create cross-app sessions
- User token validation confirms the user exists and has valid authentication
- App workspace validation prevents cross-workspace token exchange
Token Scope
- Tokens are app-specific - cannot be used across different apps
- Each workspace uses separate RSA keys for token signing
- Sessions maintain user context but are scoped to the target app
Error Handling
| Status | Error | Meaning |
|---|---|---|
| 401 | workspace_api_key_required | Invalid workspace API key |
| 403 | workspace_access_denied | User not member of workspace |
| 404 | app_not_in_workspace | Target app not in workspace |
Best Practices
- Store workspace API key securely - Never expose in client-side code
- Validate user permissions - Ensure user should have access to target app
- Handle errors gracefully - Fallback to standard login if SSO fails
- Use HTTPS only - Protect tokens in transit
- Implement token refresh - Handle token expiration seamlessly
Getting Your Workspace API Key
- Go to your Scute Dashboard
- Navigate to your workspace settings
- Generate or copy your Workspace API Key
- Store it securely in your backend environment variables