Auth Module Provider
In this guide, you’ll learn about the Auth Module Provider and how it's used.
What is an Auth Module Provider?#
An Auth Module Provider handles authenticating customers and users, either using custom logic or by integrating a third-party service.
For example, the EmailPass Auth Module Provider authenticates a user using their email and password, whereas the Google Auth Module Provider authenticates users using their Google account.
Auth Providers List#
How to Create an Auth Module Provider?#
An Auth Module Provider is a module whose service extends the AbstractAuthModuleProvider imported from @medusajs/framework/utils.
The module can have multiple auth provider services, where each is registered as a separate auth provider.
Refer to the Create Auth Module Provider guide to learn how to create an Auth Module Provider.
Configure Allowed Auth Providers of Actor Types#
By default, the user actor type is restricted to the emailpass provider. All other actor types (for example, customer) can authenticate with any installed Auth Module Provider unless you explicitly restrict them.
To configure which auth providers are allowed for each actor type, use the authMethodsPerActor option in Medusa's configurations:
authMethodsPerActor configuration, it overrides the default. So, if you don't specify any providers for an actor type, users of that actor type can't authenticate with any provider.