-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a customer account api example #1126
Conversation
2f37737
to
2bd53cb
Compare
Thanks for this example @blittle I'm playing with your example and followed the readme. I updated the .env file with my credentials, I also updated the ngrok command. I tried with different storefronts and I always get the same error: |
session.set('code-verifier', verifier); | ||
|
||
loginUrl.searchParams.append('code_challenge', challenge); | ||
loginUrl.searchParams.append('code_challenge_method', 'S256'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @blittle 👋 -- I'd be interested to know why you implemented PKCE given this is run server side?
origin: string, | ||
) { | ||
const clientId = customerAccountId; | ||
const customerApiClientId = '30243aa5-17c1-465a-8493-944bcc4e88aa'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent an age trying to figure out why I was getting the following error:
{
error: 'invalid_request',
error_description: "Invalid 'scope' value: no useable scope on target application"
}
It turns out it was because I was passing my stores Customer Account API Client ID instead of this magical uuid.
Might be worth updating these docs to include the audience
field and mention where to get the value from -- https://shopify.dev/docs/api/customer#step-use-access-token
Aside, thanks for this example -- it certainly helped me 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @richardscarrott. I agree, this magic uuid is not obvious.
Add an example using the new Customer Account API
Follow the readme instructions to try it out.