Set up Azure AD

  1. Visit the Azure Portal and create an account if needed.
  2. Navigate to “Microsoft Entra ID”.
  3. Under “Manage”, select “App Registrations”.
  4. Click ”+ New Registration” and fill out the form:
    • Name: Choose a descriptive name
    • Supported Account Type: Select based on your needs
    • Redirect URI: Choose “Web” and enter your Auth service’s callback URL (e.g., https://<subdomain>.auth.<region>.nhost.run/v1/signin/provider/azuread/callback)
    • Click “Register”

Find the Redirect URL in your project settings -> Sign In Methods after enabling Azure AD.

  1. Copy the “Application (client) ID” for later use.
  2. Create a new client secret:
    • Click “Add a certificate or secret”
    • Select “New client secret”
    • Set a description and expiration time
    • Copy the secret’s “Value” (not the ID)

Configure Nhost

  1. Go to your project’s settings -> Sign In Methods.
  2. Find Azure AD, enable it, and enter the client ID and secret.
  3. Save your changes.

User Sign-In

Use the Nhost JavaScript client to sign in users:

nhost.auth.signIn({
  provider: 'azuread'
})

To use your own domain for the callback URL refer to the custom domains documentation.