Skip to content

Microsoft

This guide explains how to configure Microsoft OAuth authentication for the DataSpace application.

  • A Microsoft Azure Active Directory (Azure AD) tenant
  • Admin access to create app registrations in Azure AD
  1. Go to the Azure Portal
  2. Navigate to Azure Active Directory > App registrations
  3. Click New registration
  4. Fill in the following details:
    • Name: DataSpace Application (or your preferred name)
    • Supported account types: Choose based on your needs:
      • “Accounts in this organizational directory only” (single tenant)
      • “Accounts in any organizational directory” (multi-tenant)
      • “Accounts in any organizational directory and personal Microsoft accounts” (multi-tenant + personal)
    • Redirect URI:
      • Platform: Web
      • URI: the backend URL (BACKEND_BASE_URL) followed by /signin-microsoft, e.g., https://api.dataspace.acme.com/signin-microsoft
  5. Click Register
  1. In your app registration, go to Authentication
  2. Add additional redirect URIs if needed for different environments
  3. Click Save
  1. Go to API permissions
  2. Click Add a permission
  3. Select Microsoft Graph
  4. Choose Delegated permissions
  5. Add the following permissions:
    • openid (Sign users in)
    • profile (View users’ basic profile)
    • email (View users’ email address)
  6. Click Add permissions
  7. Click Grant admin consent (if you have admin rights)
  1. Go to Certificates & secrets
  2. Click New client secret
  3. Add a description (e.g., “DataSpace App Secret”)
  4. Choose expiration period (recommend 24 months)
  5. Click Add

Set the client ID in .env and write the client secret to secrets/microsoft_client_secret. Then run ./start.sh so the backend picks them up.

MICROSOFT_CLIENT_ID=your-client-id-here

An empty client ID disables Microsoft sign-in.