MicrosoftAdapter

new MicrosoftAdapter(options)

Parse Server Configuration

To configure Parse Server for Microsoft authentication, use the following structure:

Secure Configuration

{
  "auth": {
    "microsoft": {
      "clientId": "your-client-id",
      "clientSecret": "your-client-secret"
    }
  }
}

Insecure Configuration (Not Recommended)

{
  "auth": {
    "microsoft": {
      "enableInsecureAuth": true
    }
  }
}

The adapter requires the following authData fields:

  • Secure Authentication: code, redirect_uri.
  • Insecure Authentication (Not Recommended): id, access_token.

Auth Payloads

Secure Authentication Payload

{
  "microsoft": {
    "code": "lmn789opq012rst345uvw",
    "redirect_uri": "https://your-redirect-uri.com/callback"
  }
}

Insecure Authentication Payload (Not Recommended)

{
  "microsoft": {
    "id": "7654321",
    "access_token": "AQXNnd2hIT6z9bHFzZz2Kp1ghiMz_RtyuvwXYZ123abc"
  }
}

Notes

  • Secure authentication exchanges the code and redirect_uri provided by the client for an access token using Microsoft's OAuth API.
  • Insecure authentication validates the user ID and access token directly, bypassing OAuth flows (not recommended). This method is deprecated and may be removed in future versions.
Parameters:
NameTypeDescription
optionsObject

The adapter configuration options.

Properties
NameTypeAttributesDefaultDescription
clientIdstring

Your Microsoft App Client ID. Required for secure authentication.

clientSecretstring

Your Microsoft App Client Secret. Required for secure authentication.

enableInsecureAuthboolean<optional>
false

[DEPRECATED] Enable insecure authentication (not recommended).