What the client needs
Begin with the connector resource URL supplied by the enabled account, a supported redirect destination for your client and an OAuth implementation that supports PKCES256. Keep the intended store visible to the person
connecting it. Do not infer a merchant’s choice from a previously used account
or a successful connection to a different resource.
The flow has three distinct decisions: the merchant signs in, chooses the
appropriate store context, and consents to the client’s requested access.
Completing sign-in alone is not the complete grant.
Follow discovery metadata
Read the resource’s protected-resource metadata and its advertised authorisation-server metadata. Use the advertised endpoints rather than constructing undocumented routes. The supported flow uses thecode response type, authorization_code and refresh_token grants, and the PKCE S256 challenge method. Public-client metadata advertises token-endpoint authentication method none; store access still requires a valid token and grant.
A request without a valid bearer token receives HTTP 401 and a WWW-Authenticate challenge. Follow the supported authentication or reconnect flow instead of retrying the same invalid token indefinitely.
The connector advertises client-ID metadata document support alongside dynamic
client registration. A compatible client can use its stable metadata identity;
otherwise follow the advertised registration mechanism. Register only the
redirect destinations used by the client. An OAuth metadata document
is not a promise of a separate BYOM user-management API.
Complete the flow
1
Discover the resource and authorisation server
Read the metadata advertised by the intended connector. Preserve the
resource identity throughout authorisation and token use.
2
Prepare PKCE and the redirect
Use a fresh verifier and its S256 challenge through your OAuth client.
Preserve the verifier and the client’s request state for the return; do
not put either into the model’s prompt.
3
Let the merchant choose and consent
Send the person through the supported authorisation page. Explain the
requested data access and write-proposal setting. If the person cancels,
return a cancelled connection state instead of repeatedly opening consent.
4
Exchange the returned code
Use the advertised token endpoint, matching client, redirect, PKCE
verifier and resource. Treat a refused exchange as an authentication
failure; never fall back to an unrelated store credential.
5
Verify the authorised context
Initialise MCP, call
about_this_connection and confirm the store and
grant before retrieving business information. Then discover the current
tool list.Consent has a scope
A grant is associated with the merchant, company, store and client context. It records consented data classes and whether supported write proposals are enabled. Provider scopes remain a separate requirement: a grant cannot give BYOM a Shopify permission that the store has not granted. New data classes need appropriate consent. Discover the tools available after authorisation rather than assuming that another merchant’s connection exposes the same capabilities. For example, a merchant may permit product information while withholding customer-related information. That is a valid, narrower connection. Your client should explain what it can do with that grant and ask for a separate consent change only when the person’s requested task needs it. Check each permission boundary:- Identity and resource: is this token valid for this connector resource?
- Merchant grant: has this client been allowed the needed data class and tool?
- Provider permission: does BYOM hold the required Shopify scope?
- Effect approval: has the specific consequential change received the required decision?

