Integration Module 2.0 for Medusa is outRead the announcement
M

Microsoft auth provider

medusa-plugin-microsoft-auth-provider is a Medusa plugin that provides Microsoft authentication capabilities for Medusa applications.

npm install @thepuzzlers/medusa-plugin-microsoft-auth-provider
Category
Auth
Built by
Thepuzzlers
Version
0.0.3
Monthly downloads
Loading downloads
Last updated

Medusa logo

Medusa Plugin : Microsoft-SSO

Compatibility

This starter is compatible with versions >= 2.8.3 of .

Getting Started

Installation

  1. Run
  2. Add microsoft configuration to the file

NOTE: the HOST_URL is your medusa url. it's used to create the callback api that back to your medusa application if no callback is provided by the application when requesting the token.

  1. Add the plugin to the providers array of Auth Module in

Scope (optional)

The option sets the OAuth scopes requested from Microsoft. It accepts a space-separated string or an array of strings. When provided, it replaces the default scope entirely. When omitted or empty, the default is used:

openid https://graph.microsoft.com/user.read profile email offline_access

NOTE: and are required for the login flow (the plugin reads the and calls Microsoft Graph ). A warning is logged on startup if either is missing. Any additional delegated permission must also be added to the app registration in Entra ID โ†’ API permissions.

Usage

In mobile app: eg Expo app

Events

  1. : emitted when an user successfully sign in to the app

Development & Publishing

Local development / testing (yalc)

Test the plugin in a local Medusa app before publishing. These commands use yalc, a local package store on your machine, not npm.

Publish to npm

  1. Log in to npm. The account must have publish rights on the org.

  2. Add a changeset. Choose / / and write a short summary of the changes.

    yarn changeset
  3. Bump the version. This updates and , and removes the changeset file.

    yarn changeset version
  4. Build and check the package contents. Only , , and should be listed. Make sure is not included.

  5. Publish. This runs , which publishes with public access and creates a git tag.

    yarn package:publish

    If npm 2FA is enabled, publish with a one-time password instead:

  6. Commit and push the release.

  7. Verify.

vs

Runs
Publishes toLocal yalc store ()npm registry
Who can install itOnly projects on your machineAnyone
Version bump / changelogNoYes (via changesets)
Requires NoYes

Sources: