OAuth 2.0 + PKCE
FreshlyCart uses Authorization Code with PKCE S256. Applications are provisioned and approved by FreshlyCart during controlled Beta; self-service registration is unavailable.
- Register exact redirect URIs. HTTPS is required except for approved local callbacks; wildcards and fragments are rejected.
- Generate a random 43–128-character PKCE verifier, its S256 challenge, and an opaque
state. - Redirect the merchant owner to
/oauth/authorizewithresponse_type=code,client_id, exactredirect_uri,scope,state, challenge fields, and the configured RESTresourceaudience. - Compare the returned
state, then exchange the one-time code within five minutes at/oauth/token. - Send the opaque 15-minute access token as a Bearer token. Rotate the refresh token on every refresh.
The merchant owner approves scopes and explicit location grants. Reauthorization replaces the installation’s entire grant and invalidates its outstanding credentials. A caller never chooses a merchant.
Reusing an already rotated refresh token revokes that refresh family and its active access tokens. /oauth/revoke is idempotent. REST access tokens are audience-bound and do not authorize a future MCP resource.