Environment
-
App Type: Confidential (Headless)
-
Store: Development store with password protection enabled
-
API: Customer Account API (GraphQL)
-
Authentication: OAuth 2.0 with PKCE
Issue Description
I’ve successfully implemented the OAuth flow for the Customer Account API and am receiving valid access tokens. However, when I attempt to call the Customer Account API GraphQL endpoint, I receive a 302 redirect to /password instead of the expected API response.
OAuth Flow (Working Successfully
)
-
Authorization request to:
https://shopify.com/authentication/{shop_id}/oauth/authorize -
Token exchange to:
https://shopify.com/authentication/{shop_id}/oauth/token -
Successfully receiving:
-
access_token(544 characters, starting withshcat_) -
refresh_token -
id_token -
Scopes:
openid email customer-account-api:full
-
Token Exchange Request (Confidential Client)
POST https://shopify.com/authentication/{shop_id}/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {base64(client_id:client_secret)}
grant_type=authorization_code
client_id={client_id}
redirect_uri={redirect_uri}
code={authorization_code}
code_verifier={pkce_verifier}
GraphQL API Request (Failing
)
Endpoint: https://{shop}.myshopify.com/customer/api/graphql
Postman Request:
Method: POST
URL: https://{shop}.myshopify.com/customer/api/graphql
Headers:
Authorization: {access_token}
Content-Type: application/json
Body (raw JSON):
{
"query": "query { customer { id firstName lastName } }"
}
Response:
HTTP/2 302 Found
Location: https://{shop}.myshopify.com/password
What I’ve Verified
-
Access token format is correct (starts with shcat_, 544 characters) -
Token exchange uses Basic Auth header as required for Confidential clients -
Discovery endpoint works: /.well-known/customer-account-apireturns the GraphQL URL -
Scopes match the supported scopes from /.well-known/openid-configuration -
Authorization header contains only the access token (no “Bearer” prefix, per Shopify docs) -
Tested in both Postman and backend server implementation (Go) - same result
Questions
-
Does password protection on a development store block Customer Account API access even with valid access tokens?
-
Is there a configuration setting to allow API access on password-protected dev stores?
-
Should I remove password protection for API testing, or is there something I’m missing in my implementation?
Additional Context
-
The OAuth flow completes successfully without any errors
-
The access token is valid (not expired)
-
This is a backend server implementation using the Confidential client type
-
Same behavior occurs in both automated requests and manual Postman testing
Any guidance would be greatly appreciated!