- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
authenticate - Auth Module Reference
This documentation provides a reference to the authenticate
method. This belongs to the Auth Module.
Note: You should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.
This method is used to authenticate a user using a provider. The authenticate
method of the
underlying provider is called, passing it the providerData
parameter as a parameter. The method
returns the data returned by the provider.
Refer to this guide to learn more about the authentication flows.
Example#
The following example is in the context of an API route, where
req
is an instance of the MedusaRequest
object:
Parameters#
provider
stringThe ID of the provider to authenticate the user with.
providerData
AuthenticationInputThe data to pass to the provider to authenticate the user.
providerData
AuthenticationInputReturns#
Promise
Promise<AuthenticationResponse>The details of the authentication result.
Promise
Promise<AuthenticationResponse>Was this page helpful?