With the Shopify Single Sign-On (SSO) app, you can log in automatically to a Shopify Hydrogen store after a user signs in with Google, Facebook, or another social login provider. You won’t need to set up Shopify’s native Customer Account API flow from scratch.
Here’s how the SSO app works:
1. Initiate Social Login from Shopify SSO App
- Configure SSO with Google or Facebook and add “Login with Google” or “Login with Facebook” buttons from the Shopify SSO app.
- When the user clicks, the SSO app redirects them to Google/Facebook for authentication.
2. Handle Authentication in Shopify SSO App Backend
- The SSO app’s backend securely handles:
- Token verification with Google and Facebook.
- User profile retrieval, including email, name, profile image, and more.
- There is no need to store or manage OAuth keys in your Hydrogen code. The SSO app takes care of this securely.
3. Sync or Create Shopify Customer Account
- Once the SSO app validates the social login, it checks if a Shopify customer account exists for the email. If the account is found, it fetches and links it. If not, it creates one automatically.
- The SSO app also generates a short-lived, secure JWT or customer access token for the authenticated user.
4. Redirect to Hydrogen with Auto-Login
- The SSO app sends the user back to your Hydrogen storefront with the token.
- Your Hydrogen store uses this token to log the user in automatically and create a valid session without needing the user to enter a password.
5. Session Management
- The SSO app securely exchanges or refreshes the token to keep the session going.
- For security:
- Short-lived tokens are used to start the login process.
- Long-lived sessions are handled on Shopify using the Customer Account API or Multipass for Plus stores.
Key Benefits of Using the Shopify SSO App for This
- No manual Google/Facebook API setup — the SSO app handles all identity provider configurations.
- Centralized login: allows you to manage Google, Facebook, and other IdPs in one place.
- Role-based tagging: lets you easily assign Shopify tags based on IdP attributes without needing third-party workflow apps.
- Hydrogen-compatible — The SSO app is compatible with Hydrogen and issues the access token required for Hydrogen to authenticate the customer.
- Short-lived tokens for security — the token expires quickly, but the SSO app refreshes them seamlessly in the background.
When a user signs in with Google or Facebook, they are automatically logged into your Hydrogen store without extra steps. This is powered entirely by the Shopify SSO app.
For further assistance, please feel free to contact our support team.