Skip to content

feat: Add OAuth 2.0 Client Credentials support for Shopify integration#399

Open
Z4nzu wants to merge 1 commit intofrappe:developfrom
Z4nzu:feat/shopify-oauth2-client-credentials
Open

feat: Add OAuth 2.0 Client Credentials support for Shopify integration#399
Z4nzu wants to merge 1 commit intofrappe:developfrom
Z4nzu:feat/shopify-oauth2-client-credentials

Conversation

@Z4nzu
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Author

Z4nzu commented Jan 23, 2026

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

@chinmaybhatk
Copy link
Copy Markdown

Can someone please prioritise this?
We badly need it for consumption :-)

@colepurpleparrot
Copy link
Copy Markdown

A branch that fixes a major, breaking change that completely invalidates the entire repo has been languishing without comment for 3 months. This project is officially dead. Which is a shame because I need this integration specifically for my business. Suppose its time to look into odoo. Their ecosystem is alive.

@Z4nzu
Copy link
Copy Markdown
Author

Z4nzu commented Apr 8, 2026

A branch that fixes a major, breaking change that completely invalidates the entire repo has been languishing without comment for 3 months. This project is officially dead. Which is a shame because I need this integration specifically for my business. Suppose its time to look into odoo. Their ecosystem is alive.

Let's connect and discuss. I will help you to fix that issue without relying on this module.

@colepurpleparrot
Copy link
Copy Markdown

I appreciate the offer, but I'm a developer and can fix it myself if I wanted. The issue is more that the frappe owners claim that they have a healthy ecosystem with a marketplace full of apps that solve issues but half of those apps (specifically the ones owned by them) don't work or are not updated.

It isn't limited to this app. The shipping app is useless for those living outside the EU. There's a PR that's been sitting for a year that would integrate it with a US based shipping solution. Nothing, radio silence.

When you're sold an ecosystem and that ecosystem turns out to be a barren wasteland, you feel as if you've fallen for a bait-and-switch.

@ror-coffeedesk
Copy link
Copy Markdown

Is this fixed ?

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.

4 participants