Skip to content

Shopify OAuth change #220

Open
Open
@lishanl

Description

@lishanl

What doesn't work

We used to be able to do the Shopify OAuth app installation by entering the URL in the browser: https://<app_domain>/shopify/auth?shop=<store_name> which should then directs us to a screen to authorize and complete the installation.

But this time when I was installing the st pricing engine app, it directs me to a screen below

What works

Instead, to install it, we need to use the installation link generated by Shopify for the app while the app url needs to point to the /shopify/auth route

App Distribution:

App Configuration:

The Shopify installation link will first direct user to a screen to select which store to install the app to, after selecting the store, the user will be directed to following installation screen to complete the installation.

But after the installation, I need to change the App URL to point to /health instead so that when the app is being loaded from the store. It returns a happy state.

It feels like we can modify the init oauth router to detect

def init_oauth_router(
app_scopes: List[str],
user_scopes: List[str],
public_domain: str,
private_key: str,
api_key: str,
api_secret_key: str,
post_install: Callable[[str, OfflineTokenModel], Optional[Awaitable]],
post_login: Optional[Callable[[str, OnlineTokenModel], Optional[Awaitable]]] = None,
install_init_path='/shopify/auth',
callback_path='/callback',
path_prefix: str = '',
) -> APIRouter:

  • if it is a OAuth process then initiate the OAuth process
  • if the app has been installed and being loaded from the Shopify admin, then just do something different like returning the health screen. Such requests have ?embedded=1 in the query

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions