Skip to content

Conversation

@Z4nzu
Copy link

@Z4nzu Z4nzu commented Jan 14, 2026

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.

  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

no-docs

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
@Z4nzu Z4nzu requested a review from ankush as a code owner January 14, 2026 06:36
@Z4nzu
Copy link
Author

Z4nzu commented Jan 15, 2026

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?

@Z4nzu
Copy link
Author

Z4nzu commented Jan 23, 2026

Hi @ankush , Appreciate a review when you get time.

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