You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
Feature Request: Support for expiring offline access tokens and the token exchange grant #462
Request to add support for the OAuth 2.0 Token Exchange grant and the expiring-offline-access-tokens model (refresh tokens, refresh-token grant, session fields for refresh state) to the PHP SDK, bringing parity with @shopify/shopify-api (JS) which already exposes auth.tokenExchange() and associated plumbing.
Type
New feature
Changes to existing features
Motivation
Following up on #342, which was automatically closed in July 2024 without maintainer engagement. That predates the Shopify platform changes below; opening a fresh issue rather than reopening since the context has materially shifted.
In December 2025, Shopify announced that offline access tokens now support expiry + refresh (changelog). The follow-on April 1, 2026 requirement makes expiring offline tokens mandatory for new public apps. While no timeline for retiring permanent tokens for grandfathered apps has been announced, that is a logical next step.
When #342 was filed, token exchange was a convenience over the authorization-code-grant flow. It is now the acquisition path for the new expiring-offline-token grant type, and refresh-token handling is not optional for new public apps.
As of v6.1.1, the PHP SDK has no TokenExchange helper, no refresh_token / refresh_token_expires_at fields on Session, no parsing of expires_in / refresh_token / refresh_token_expires_in in OAuth::callback or AccessTokenResponse, and no grant_type=refresh_token helper - features all present in JS @shopify/shopify-api via auth.tokenExchange() and related APIs.
PHP apps building for the new model have to implement custom code for the token-exchange acquisition grant (online and offline, with optional expiring=1), the non-expiring-to-expiring migration exchange, and the refresh grant with single-use-refresh-token collision handling - plus carrying refresh-token state somewhere out-of-band from Session.
Is official PHP SDK support for token exchange + expiring offline tokens on the roadmap now? If maintainers are open to it but unstaffed, community contribution via PR may be viable - a clear statement either way would help app teams plan their implementations.
Public apps must use expiring tokens for offline access. Public apps created on or after April 1, 2026 must use expiring tokens, and public apps created before April 1, 2026 must migrate to expiring tokens by January 1, 2027. Starting January 1, 2027, public apps that make REST or GraphQL Admin API requests with non-expiring tokens receive error responses. These requirements don't apply to custom apps or apps created by merchants.
Now that there is an official date for this being required and new apps can no longer use the previous tokens, this seems critically important for the SDK to support.
Thanks for contributing! This package is deprecated and we're archiving this repo, so we're closing all open issues and PRs. Please use shopify-app-php instead, and open new issues there. More context: Rethinking support for PHP/Python packages
Activity
Bastlynn commentedon Jun 2, 2026
Seconding this request, please and many thanks.
Mark-H commentedon Jul 8, 2026
Now that there is an official date for this being required and new apps can no longer use the previous tokens, this seems critically important for the SDK to support.
darrynten commentedon Aug 11, 2026
is there a migration path for existing apps currently using the non-expiring tokens with the linked pull request?
Suleimanlatrsh commentedon Oct 6, 2026
Thanks for contributing! This package is deprecated and we're archiving this repo, so we're closing all open issues and PRs. Please use shopify-app-php instead, and open new issues there. More context: Rethinking support for PHP/Python packages