Tag
Blog: Configuration
All blog posts tagged with Configuration.

Multi-Tenancy Setup Guide

Configure multi-tenant authentication for SaaS applications with proper isolation and customization.

Tenant Configuration

{
  "tenant": {
    "id": "tenant-123",
    "name": "Acme Corp",
    "domain": "acme.auth.com",
    "settings": {
      "branding": {
        "logo": "https://...",
        "colors": {
          "primary": "#007bff"
        }
      }
    }
  }
}

Data Isolation

Each tenant has isolated:

  • User database
  • Configuration
  • Audit logs
  • API keys

Custom Domains

server {
  server_name *.auth.com;
  
  location / {
    proxy_pass http://auth-service;
    proxy_set_header X-Tenant-ID $tenant_id;
  }
}

Tenant Resolution

const tenant = await resolveTenant({
  domain: req.hostname,
  apiKey: req.headers['x-api-key']
});

For advanced configurations, see our enterprise documentation.

Custom Domain Configuration

Set up custom domains to provide branded authentication experiences.

DNS Configuration

Add the following records to your DNS:

Type    Host            Value
CNAME   auth           verify.authcompany.com
TXT     _verify.auth    verification-token-123

SSL Certificate Setup

domain:
  name: auth.yourcompany.com
  ssl:
    autoProvision: true
    provider: letsencrypt

Verification Process

const domainSetup = await auth.domains.create({
  domain: 'auth.yourcompany.com',
  verifyOwnership: true
});

console.log(domainSetup.verificationToken);

Nginx Configuration

server {
    server_name auth.yourcompany.com;
    
    ssl_certificate /etc/ssl/certs/auth.yourcompany.com.crt;
    ssl_certificate_key /etc/ssl/private/auth.yourcompany.com.key;
    
    location / {
        proxy_pass http://auth-backend;
        proxy_set_header Host $host;
    }
}

For wildcard certificates and advanced setups, see our enterprise guide.