# Microsoft personal account sign in fails on /common and Nylas callback fails after /consumers

**URL:** <https://forums.nylas.com/t/microsoft-personal-account-sign-in-fails-on-common-and-nylas-callback-fails-after-consumers/932>\
**Category:** Question and Answers\
**Tags:** authentication, calendar-api\
**Created:** [September 26, 2025, 1:46pm UTC](https://forums.nylas.com/t/microsoft-personal-account-sign-in-fails-on-common-and-nylas-callback-fails-after-consumers/932 "2025-09-26T13:46:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agentic](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@agentic](https://forums.nylas.com/u/agentic)\
**Post date:** [September 26, 2025, 1:46pm UTC](https://forums.nylas.com/t/microsoft-personal-account-sign-in-fails-on-common-and-nylas-callback-fails-after-consumers/932/1 "2025-09-26T13:46:09Z")

</div>

Hi team,

I am integrating Microsoft calendars through Nylas Hosted Auth. Google connects fine.

For Microsoft:

If the flow hits /common, I get: You cannot sign in here with a personal account. Use your work or school account instead.

If I force /consumers, Microsoft shows consent and emails me that the app is connected, but my app returns to /app/assistant/calendar?error=oauth\_error.

I need help making personal Microsoft accounts work on /common and completing the Nylas token exchange without errors.

### Environment

Please assume redacted values below. I will share exact values with support privately if needed.

- Region: Nylas US
- Framework: Next.js (App Router)
- Microsoft Graph permissions: User.Read, offline\_access, openid, email, profile, Calendars.Read, Calendars.ReadWrite
- Azure sign in audience: Accounts in any organizational directory and personal Microsoft accounts

### What I am trying to do

Let users connect a Microsoft personal account or a work account to my app using Nylas Hosted Auth. Store the Nylas grant and list calendars.

### Expected result

Personal Microsoft accounts should sign in on /common

After consent, Nylas should redirect back to my callback and I should be able to exchange for a Nylas grant

### Actual result

**/common:** Microsoft shows “You cannot sign in here with a personal account. Use your work or school account instead.”

**/consumers:** Microsoft consent completes and sends the security email, then my app lands on

`…/calendar?error=oauth_error&message=Calendar connection was cancelled or failed.`

### Repro steps

Start OAuth using Nylas Hosted Auth URL generated by the SDK

For /common: user enters a personal Microsoft account and gets the work or school only message

For /consumers: user completes consent, Microsoft emails confirmation, then redirect to my app shows oauth\_error

### Current configuration

- Azure App Registration
- Application ID: \<AZURE\_CLIENT\_ID\>
- Supported account types: Any organizational directory and personal Microsoft accounts
- Redirect URIs (Web): includes [https://api.us.nylas.com/v3/connect/callback](https://api.us.nylas.com/v3/connect/callback)
- Certificates and secrets: client secret value is set and not expired
- Nylas Microsoft connector
- Provider: microsoft
- Tenant: common
- Client ID: \<AZURE\_CLIENT\_ID\>
- Client secret: \<AZURE\_CLIENT\_SECRET\_VALUE\>
- Scopes mirror the Azure app

### App code

#### 

Start of flow (server action):

```typescript
const authUrl = nylasClient.auth.urlForOAuth2({clientId: process.env.NYLAS_CLIENT_ID!,redirectUri: ${process.env.NEXT_PUBLIC_APP_URL}/app/integrations/nylas/oauth/callback,state: JSON.stringify({ businessId: “”, provider: “microsoft” }),provider: “microsoft”});

```

#### Callback exchange:

```typescript
const grant = await nylasClient.auth.exchangeCodeForToken({clientId: process.env.NYLAS_CLIENT_ID!,redirectUri: ${process.env.NEXT_PUBLIC_APP_URL}/app/integrations/nylas/oauth/callback,code,});

```

### Observed behavior and URLs

#### URL via tenant common

```auto
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=<AZURE_CLIENT_ID>&redirect_uri=https%3A%2F%2Fapi.us.nylas.com%2Fv3%2Fconnect%2Fcallback&response_type=code&scope=User.Read+offline_access+openid+email+profile+Calendars.Read+Calendars.ReadWrite&prompt=select_account&state=<REDACTED>&tenant=common

```

Result: personal accounts are blocked with the work or school only message.

#### URL via tenant consumers

```auto
https://login.live.com/oauth20_authorize.srf?client_id=<AZURE_CLIENT_ID>&redirect_uri=https%3A%2F%2Fapi.us.nylas.com%2Fv3%2Fconnect%2Fcallback&response_type=code&scope=User.Read+offline_access+openid+email+profile+Calendars.Read+Calendars.ReadWrite&prompt=select_account&state=<REDACTED>&tenant=consumers

```

Result: consent completes and Microsoft sends the app connected email. My app then receives an oauth\_error on the return from Nylas.

### Troubleshooting already done

- Confirmed Azure app sign in audience allows personal accounts
- Confirmed Azure redirect URIs include the Nylas Hosted Auth callback
- Confirmed Nylas connector tenant is common and credentials match the Azure app
- Confirmed provider string passed to Nylas is microsoft
- Google calendar OAuth works end to end with the same callback handler
- Reproduced that forcing /consumers reaches consent, so the Azure app and scopes are valid

Can you please help understand what I am doing wrong? Thanks a lot

---

<div class="post-metadata">

**Author:** ![jean1199](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jean1199](https://forums.nylas.com/u/jean1199)\
**Post date:** [October 1, 2025, 10:31pm UTC](https://forums.nylas.com/t/microsoft-personal-account-sign-in-fails-on-common-and-nylas-callback-fails-after-consumers/932/2 "2025-10-01T22:31:52Z")

</div>

Hi Agentic, please see step 3 under “Create and Azure Application”, When creating an OAtuh app, select the third option that mention personal account.

> **[Creating an Azure auth app | Nylas Docs](https://developer.nylas.com/docs/provider-guides/microsoft/create-azure-app/?redirect=reorg#create-an-azure-oauth-application)**
>
> Create and configure a Microsoft Azure auth app.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/nylas3/original/1X/413092584be52d306c97418a03688fc05aa58831.jpeg)
