> **Building with AI coding agents?** If you're using an AI coding agent, install the official Scalekit plugin. It gives your agent full awareness of the Scalekit API — reducing hallucinations and enabling faster, more accurate code generation.
>
> - **Claude Code**: `/plugin marketplace add scalekit-inc/claude-code-authstack` then `/plugin install <auth-type>@scalekit-auth-stack`
> - **GitHub Copilot CLI**: `copilot plugin marketplace add scalekit-inc/github-copilot-authstack` then `copilot plugin install <auth-type>@scalekit-auth-stack`
> - **Codex**: run the bash installer, restart, then open Plugin Directory and enable `<auth-type>`
> - **Skills CLI** (Windsurf, Cline, 40+ agents): `npx skills add scalekit-inc/skills --list` then `--skill <skill-name>`
>
> `<auth-type>` / `<skill-name>`: `agent-auth`, `full-stack-auth`, `mcp-auth`, `modular-sso`, `modular-scim` — [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Microsoft as your sign in option

Scalekit enables apps to easily let users sign in using Microsoft as their social connector. This guide walks you through the process of setting up the connection between Scalekit and Microsoft, and using the Scalekit SDK to add "Sign in with Microsoft" to your application.

<figure>
  ![A diagram showing "Your Application" connecting to "Scalekit" via OpenID Connect, which links to Microsoft using OAuth 2.0.](@/assets/docs/common/poster-scalekit-social.png)
</figure>

By the end of this guide, you will be able to:

1. Set up an OAuth 2.0 connection between Scalekit and Microsoft
2. Use the Scalekit SDK to add "Sign in with Microsoft" to your application

## Connect Microsoft with Scalekit

1. Navigate to social login settings
   Open your Scalekit dashboard and navigate to Social Login under the Authentication section.

   <figure>
     ![Scalekit dashboard showcasing social login setup with various platform integration options.](@/assets/docs/common/social-connections/1-navigate-to-social-logins.png)
   </figure>

2. Add a new Microsoft connection
   Click the "+ Add Connection" button and select Microsoft from the list of available options.

   <figure>
     ![Add social login connections: Google, Microsoft, GitHub, GitLab, Salesforce.](@/assets/docs/common/social-connections/2-list-social-logins.png)
     <figcaption>Add social login connections: Microsoft</figcaption>
   </figure>

## Configure OAuth settings

The OAuth Configuration details page helps you set up the connection:

- Note the **Redirect URI** provided for your app. You'll use this URL to register with Microsoft.
- **Client ID** and **Client Secret** are generated by Microsoft when you register an OAuth App. They enable Scalekit to authenticate your app and establish trust with Microsoft.

<figure>
  ![Microsoft OAuth configuration in Scalekit, showing redirect URI, client credentials, and scopes for social login setup.](@/assets/docs/guides/social-connections/microsoft-1.png)

</figure>

## Set up Microsoft OAuth 2.0

Microsoft lets you set up OAuth through the Microsoft Identity Platform.
<a href="https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app" target="_blank">Follow Microsoft's instructions to set up OAuth 2.0</a>.

1. Use the Redirect URI from Scalekit as the <a href="https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate#add-a-redirect-uri" target="_blank">Redirect URI in Microsoft's setup</a>
2. Copy the generated Client ID and Client Secret into the Scalekit Dashboard
3. Click "Save Changes" in Scalekit for the changes to take effect

<figure>
  ![Microsoft OAuth configuration for social login, showing redirect URI, client ID, and scopes for authentication.](@/assets/docs/guides/social-connections/microsoft-2.png)
</figure>

## Choose the user experience for login prompt

Scalekit offers flexibility to control how and when users are prompted for reauthentication, consent, or account selection. Below are the available options for customizing user sign-in behavior:

- _Auto Sign-in (default)_:
  Automatically completes the login process without showing any confirmation prompts. This is ideal for single account users who are already logged in and have previously provided consent.

- _Consent_:
  The authorization server triggers a consent screen after sign-in, asking the user to grant permissions to the app.

- _Select Account_:
  The authorization server prompts the user to select a user account. This allows a user who has multiple accounts at the authorization server to select amongst the multiple accounts that they may have current sessions for.

- _Login_:
  Forces the user to re-enter their credentials and log in, even if a valid session already exists.

- _None_:
  Performs a background authentication check without displaying any screens. If the user is not authenticated or hasn't provided consent, an error will be returned.

## Test the connection

1. Click the "Test Connection" button in Scalekit
2. You will be redirected to the Microsoft Consent screen to authorize access
3. A summary table will show the information that will be sent to your app

<figure>
  ![Test connection success](@/assets/docs/common/social-connections/5-successful-test-connection.png)
  <figcaption>Test connection success, showing the consent screen and summary table.</figcaption>
</figure>

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
