next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

Custom Shopify Provider Question

Open jberrydev opened this issue 3 years ago • 0 comments

Question 💬

I am working on making a custom shopify provider, but shopify sets its authorization and token urls dynamically like so:

https://${shop}.myshopify.com/admin/oauth/authorize
https://${shop}.myshopify.com/admin/oauth/access_token

I plan on making a text input that will allow the user to input the shop name, but I am not sure how or if it is possible to pass this to the next-auth configuration. Following this documentation: https://next-auth.js.org/configuration/providers/oauth#authorization-option

My gut tells me this isn't possible and may have to use a CredentialProvider, but wanted to make sure before moving forward.

How to reproduce ☕️

Not a bug just a question.

Contributing 🙌🏽

No, I am afraid I cannot help regarding this

jberrydev avatar Aug 10 '22 00:08 jberrydev

I would keep it to the specs, just use issuer. See https://github.com/nextauthjs/next-auth/pull/3964/files#r862707357

Feel free to open a PR to make this addition to the built-in providers! Sadly, Shopify is not fully OAuth compliant though. 😕. See #3964 for more context

balazsorban44 avatar Aug 10 '22 22:08 balazsorban44

And you can totally make this configurable by using https://next-auth.js.org/configuration/initialization#advanced-initialization just make sure to handle the user input securely. 👍

balazsorban44 avatar Aug 10 '22 22:08 balazsorban44