-
-
Notifications
You must be signed in to change notification settings - Fork 157
modify SessionToken to be compatible with Checkout UI Extension #329
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
Conversation
9b59acd
to
99bc6cd
Compare
@jeroendelau are you able to add a wiki page on how this would be use for the checkout extension vs the main laravel application? |
absolutely, I will try to get something in there before the end of the week. |
@jeroendelau great work on this. |
No, sorry, simply had no time. Will fix |
I think I fixed all linter issues, but I'm having trouble reproducing the same error locally. |
a6ddb7e
to
aae249e
Compare
Added in separate PR #346 The reason I couldn't get the linter to fail was because the local version does not match the version of github actions. github action 3.0.0 After setting composer to 3.0.0 the errors matched. Suggest adjusting the lint action to use the composer version so mismatch can't happen.
|
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.
Looks great
@jeroendelau Thanks for this PR! I've been working on a Customer Account UI extension. I've noticed this code improperly classifies the session token from the Customer Account UI extension as an app session token because the https://shopify.dev/docs/api/customer-account-ui-extensions/latest ![]() |
@blazerunner44 happy to hear someone is using it! I haven't worked with it for a while, so I didn't encounter this myself. But let's see if we can't resolve this. So the original issue was that the However, I didn't simply want to remove the check, so I tried to create a strict a scenario as I could to only skip checking it if specific fields were missing, and all missing. Now that Shopify is sometimes adding these fields, it starts to become brittle. So, from my perspective, We have two options:
add. with option 2, the need to determine tokenSource goes out the window. It could be removed, but I can't be sure that nobody is relying on it. Maybe we can find a different method? |
@jeroendelau Appreciate you taking the time with a thoughtful response. This is my first dive into Shopify and am very much figuring things out as I go. Shopify didn't issue the I do like the method to determine the tokenSource. Seems useful for people who might want to determine how a request is received. A quick dive into the Shopify documentation about the To me it makes sense that a sid wouldn't be issued for a checkout/account UI extension as there's no authenticated Shopify user using the app. Unless they change the definition in the future, it seems safe to remove the check for |
Makes sense, is this raised in an issue anywhere? Would you be ok to create
a PR for this?
…On Fri, 26 Sep 2025 at 18:22, Jaden Taylor ***@***.***> wrote:
*blazerunner44* left a comment (Kyon147/laravel-shopify#329)
<#329 (comment)>
@jeroendelau <https://github.com/jeroendelau> Appreciate you taking the
time with a thoughtful response. This is my first dive into Shopify and am
very much figuring things out as I go.
Shopify didn't issue the iss field back when this PR was being worked on,
but now it is included. Is it safe to say this code doesn't work across the
board right now, or could there be cases where Shopify still doesn't issue
the iss field (older API versions, Checkout UI vs Account UI extensions,
etc)?
I do like the method to determine the tokenSource. Seems useful for people
who might want to determine how a request is received.
A quick dive into the Shopify documentation about the sid field on the
token indicates:
sid: A unique session ID per user and app.
Shopify docs
<https://shopify.dev/docs/apps/build/authentication-authorization/session-tokens>
To me it makes sense that a sid wouldn't be issued for a checkout/account
UI extension as there's no authenticated Shopify user using the app. Unless
they change the definition in the future, it seems safe to remove the check
for iss from determineTokenSource and rely soely on the sid field, your
option #1 <#1> above.
—
Reply to this email directly, view it on GitHub
<#329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIKX4SAJ4AF2BT5AWTWJNT3UVR4HAVCNFSM6AAAAACHQQPWZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMZZGQ2TSMBVGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've been following your conversation, let me know when you want a review on this PR and thanks for your help 🙏 |
@jeroendelau @Kyon147 Quick PR to remove the iss field check #452 |
Checkout UI Extensions have session tokens, but they vary slightly from the token provided by Shopify Apps.
App Session Tokens
Checkout Extension Session Tokens
Key differences:
By merging this PR people should be able to use session tokens obtained through useSessionToken, to interact with the back-end without modification.