Skip to content

Renew Shopify app tokens and report missing scopes - #4

Merged
mpge merged 7 commits into
mainfrom
feat/client-credentials-auth
Oct 23, 2026
Merged

mpge merged 7 commits into
mainfrom
feat/client-credentials-auth

Conversation

@mpge

@mpge mpge commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

TL;DR: Stores owned by the same Shopify organization as their app can connect with a client ID and secret; Inventoros renews their expiring access tokens automatically. Connection tests also name missing API scopes.

Adds an optional authentication mode while preserving manually supplied tokens. Tokens and expiry stay in the existing encrypted credentials; a row lock serializes renewal and tokens renew two minutes before expiry before API requests, including later pages of a running sync. The existing API secret key doubles as the app client secret. Credential rotation clears cached tokens and retests the connection. Credentials/client IDs are write-only and excluded from validation-session old input; exchange errors never echo provider bodies.

This is Shopify's client-credentials grant for an app and stores in the same Shopify organization, not an OAuth redirect flow for unrelated merchants. Grant failures explain that constraint.

Stacked on #3; merge #3 first. Validation: all 133 plugin tests pass (771 assertions), including encrypted storage, reuse/renewal, missing scopes, settings changes and failed-validation input protection. Runtime UI builds. Provider requests are faked; no live store was changed.

Reference: https://shopify.dev/docs/apps/build/authentication-authorization/client-credentials-grant

GitHub-hosted CI currently cannot start: GitHub reports failed account payments or a spending-limit restriction. No build steps ran; local validation above passed.

@mpge
mpge changed the base branch from fix/bounded-api-pagination to main October 23, 2026 15:46
@mpge
mpge merged commit 3b603d2 into main Oct 23, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant