feat: Add OAuth 2.0 Client Credentials support for Shopify integration#399
Open
Z4nzu wants to merge 1 commit intofrappe:developfrom
Open
feat: Add OAuth 2.0 Client Credentials support for Shopify integration#399Z4nzu wants to merge 1 commit intofrappe:developfrom
Z4nzu wants to merge 1 commit intofrappe:developfrom
Conversation
Adds OAuth 2.0 Client Credentials Grant flow support to Shopify integration, maintaining full backward compatibility with existing Static Token authentication. Starting from **January 1, 2026**, all new Shopify custom apps created via the [Shopify Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard/create-apps-using-dev-dashboard) must use OAuth 2.0 Client Credentials for authentication instead of static access tokens. This PR implements the new authentication method while preserving existing functionality for apps created before this date. - **Shopify Documentation:** - [OAuth 2.0 Client Credentials Grant](https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/client-credentials-grant) - [Creating Apps Using Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard/create-apps-using-dev-dashboard) - [Access Token Migration Guide](https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens) - **Related Issue:** #[issue-number] (if applicable) 1. **Dual Authentication Support** - Static Token (for apps created before Jan 1, 2026) - OAuth 2.0 Client Credentials (for apps created after Jan 1, 2026) - Seamless switching between authentication methods 2. **Automatic Token Management** - On-demand token generation - Runtime token refresh (no cron jobs) - 5-minute expiry buffer to prevent mid-request failures - Retry logic with exponential backoff 3. **Enhanced UI** - Authentication Method selector - Dynamic field visibility based on selected method - Clear field labels and descriptions **Core Implementation:** - `ecommerce_integrations/shopify/oauth.py` (new) - OAuth token management - `ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py` - Enhanced with OAuth support - `ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.json` - Added OAuth fields - `ecommerce_integrations/shopify/connection.py` - Dual auth support **Migration & Documentation:** - `ecommerce_integrations/patches/set_default_shopify_auth_method.py` - Backward compatibility - `ecommerce_integrations/patches.txt` - Patch registration
Author
|
Hi @ankush, Can you please look into this PR as custom apps created after 1st Jan 2026 needs this feature else it won't work further? |
Author
|
Hi @ankush , Appreciate a review when you get time. |
|
Can someone please prioritise this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds OAuth 2.0 Client Credentials Grant flow support to Shopify integration, maintaining full backward compatibility with existing Static Token authentication.
Starting from January 1, 2026, all new Shopify custom apps created via the Shopify Dev Dashboard must use OAuth 2.0 Client Credentials for authentication instead of static access tokens.
This PR implements the new authentication method while preserving existing functionality for apps created before this date.
Dual Authentication Support
Automatic Token Management
Enhanced UI
Core Implementation:
ecommerce_integrations/shopify/oauth.py(new) - OAuth token managementecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py- Enhanced with OAuth supportecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.json- Added OAuth fieldsecommerce_integrations/shopify/connection.py- Dual auth supportMigration & Documentation:
ecommerce_integrations/patches/set_default_shopify_auth_method.py- Backward compatibilityecommerce_integrations/patches.txt- Patch registrationno-docs