Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Use Shopify credential to log in to Auth0 application

Use Shopify credential to log in to Auth0 application

andyjpg
Shopify Partner
8 0 1

Hi Community Team,

 

We have a web application that uses Auth0 for authentication, and we want to allow Shopify users to log in to our application with their Shopify credentials.

We have tried Shopify social connection in Auth0 https://marketplace.auth0.com/integrations/shopify-social-connection but it only allows us to connect to a single store. In our case, we want every Shopify user to be able to log in.

Does anyone have the same use case? I would love to hear how people approach this problem.

 

Thank you

Andy

Replies 3 (3)

Liam
Community Manager
3108 344 904

Hey Andy - could Multipass work for this use-case: https://shopify.dev/docs/api/multipass

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

andyjpg
Shopify Partner
8 0 1

Hi Liam,
Thanks for your reply.

I read through multipass, it allows login through multiple stores under the same store owner.

What we are aiming for is to allow different store owners to log in to our application with their Shopify account, something like login with a Google account.

Do you have any suggestions for it?

Thank you

Andy

Liam
Community Manager
3108 344 904

Hi again Andy,

 

Since Auth0 does not natively support this multi-store Shopify login directly, it sounds like you'll need to set up a custom Auth0 connection, using Auth0's Custom Social Connections resource. This extension allows you to configure your own OAuth 2.0 connection, which you can point to your custom OAuth implementation.

 

The flow would be, when a merchant logs in they would be directed to Shopify's OAuth authorization URL, which would include your app's client ID and the requested scopes, they would authorize your app to access their store data and then redirect back to your application with a temporary authorization code. Your app would then exchange this code for an access token by making a POST request to Shopify, and this access token would be specific to the store and the app. 

 

This might not be the most elegant solution though - so hopefully other devs can suggest a flow that's more efficient and easier to implement. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog