- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Google Auth Module Provider
In this document, you’ll learn about the Google Auth Module Provider and how to install and use it in the Auth Module.
The Google Auth Module Provider authenticates users with their Google account.
Register the Google Auth Module Provider#
Add the module to the array of providers passed to the Auth Module:
1import { Modules } from "@medusajs/framework/utils"2 3// ...4 5const modules = {6 // ...7 [Modules.AUTH]: {8 resolve: "@medusajs/medusa/auth",9 options: {10 providers: [11 // other providers...12 {13 resolve: "@medusajs/medusa/auth-google",14 id: "google",15 options: {16 clientId: process.env.GOOGLE_CLIENT_ID,17 clientSecret: process.env.GOOGLE_CLIENT_SECRET,18 callbackUrl: process.env.GOOGLE_CALLBACK_URL,19 },20 },21 ],22 },23 },24}
Environment Variables#
Make sure to add the necessary environment variables for the above options in .env
:
Module Options#
Configuration | Description | Required |
---|---|---|
| A string indicating the Google API Client ID. | Yes |
| A string indicating the Google Client Secret. | Yes |
| A string indicating the URL to redirect to in your frontend after the user completes their authentication in Google. At this URL, the frontend will receive a | Yes |