Microsoft auth provider
medusa-plugin-microsoft-auth-provider is a Medusa plugin that provides Microsoft authentication capabilities for Medusa applications.
- Категория
- Авторизация
- Создано
- Thepuzzlers
- Версия
- 0.0.3
- Ежемесячные загрузки
- Загрузка данных
- Последнее обновление
Medusa Plugin : Microsoft-SSO
Compatibility
This starter is compatible with versions >= 2.8.3 of .
Getting Started
Installation
- Run
- 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.
- 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_accessNOTE: 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
- : 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
-
Log in to npm. The account must have publish rights on the org.
-
Add a changeset. Choose / / and write a short summary of the changes.
yarn changeset -
Bump the version. This updates and , and removes the changeset file.
yarn changeset version -
Build and check the package contents. Only , , and should be listed. Make sure is not included.
-
Publish. This runs , which publishes with public access and creates a git tag.
yarn package:publishIf npm 2FA is enabled, publish with a one-time password instead:
-
Commit and push the release.
-
Verify.
vs
| Runs | ||
| Publishes to | Local yalc store () | npm registry |
| Who can install it | Only projects on your machine | Anyone |
| Version bump / changelog | No | Yes (via changesets) |
| Requires | No | Yes |
Sources:
- Medusa Plugins documentation
- Create Auth Provider Plugin
- Medusa installation
- Medusa auth google provider plugin
- Microsoft OIDC
- Request an authorization code
- PKCE auth flow with rfc
- Medusa Third party service auth flow
- Medusa Third party social login storefront
- The Medusa auth plugin, using the deprecated version of passport-azure-ad
- Microsoft id_token properties
- Example of decoded id_token after the access_token redemption
- Custom auth strategy
- React Native Authorization Code Grant Flow
- adding changeset
- Medusa AuthIdentityProviderService

