Skip to main content

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

  1. User is already authenticated in App A within your workspace
  2. 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)
  3. Receive new session tokens for the user in App B
  4. 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

Best Practices

  1. Store workspace API key securely - Never expose in client-side code
  2. Validate user permissions - Ensure user should have access to target app
  3. Handle errors gracefully - Fallback to standard login if SSO fails
  4. Use HTTPS only - Protect tokens in transit
  5. Implement token refresh - Handle token expiration seamlessly

Getting Your Workspace API Key

  1. Go to your Scute Dashboard
  2. Navigate to your workspace settings
  3. Generate or copy your Workspace API Key
  4. Store it securely in your backend environment variables