The error was: "redirect_uri" mismatch when trying to access /account

The error was: "redirect_uri" mismatch when trying to access /account

rattlesnakeMT
Shopify Partner
27 2 1

I'm trying to work on account routes on my headless shopify site.

 

In my .env I have PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID and PUBLIC_CUSTOMER_ACCOUNT_API_URL set.

 

When I try to access https://localhost:3000/acount, I get

 

An error occured
invalid_request
The error was: "redirect_uri" mismatch
Show request details

client_id=shp_REMOVED
scope=openid email https://api.customers.com/auth/customer.graphql
response_type=code
redirect_uri=https://localhost:3000/account/authorize
state=1714006606007p36pyjst7v
nonce=9d50d17b6d99069f109749c5dfdb3089
code_challenge=WxiKDVlxdnNuRtzaaTtUO4HY9E8gMOz1gfghnp9bPho
code_challenge_method=S256
Request ID: 1747e616-6afb-4139-a058-1b7362fac516-1714006606

 

When I try to access the public storefront, I get

 

An error occured
invalid_request
The error was: "redirect_uri" mismatch
Show request details

client_id=shp_REMOVED
scope=openid email https://api.customers.com/auth/customer.graphql
response_type=code
redirect_uri=https://REMOVED.o2.myshopify.dev/account/authorize
state=1714006822000j6ccydk36hh
nonce=6c94aec7d0bf9e21263a0014e7ddb4c8
code_challenge=YhTeCemwg4U4odXvgZyP3SxTodaqKzD-dnVeH43m31U
code_challenge_method=S256
Request ID: cef16eb7-5dea-48ee-9691-ab6da0c805c0-1714006822

 

In settings / customer accounts I have it set to Classic customer accounts, but I've New customer accounts too. Get the same error either way.

 

I think the redirect is the problem. It's redirecting me to

https://shopify.com/REMOVED/auth/oauth/authorize?client_id=shp_0b805f6a-95df-44df-bfe3-84195ea696ac&...

 

So I'm not sure if the fact that shopify.com doesn't match my storefront URL?

Any suggestions on getting this to work?

 

 

 

Hank D
Reply 1 (1)

Lsenn_
Shopify Partner
1 0 1

running into the same issue currently, could you let me know if you have figured out a solution?