DudeAmI
DudeAmI

Reputation: 21

Shopify OAuth Authentication with redirect_uri returns invalid_request

I am working on creating a shopify and have run into some problems. When trying to authenticate the users, I get this error message:

{
    "error": "invalid_request",
    "error_description": "The redirect_uri and application url must have matching hosts"
}

The redirect_uri and Application URL are both set to 'http://serv.dudeami.com/shopify/public/'. I am not sure if its the subdomain throwing it off, but no matter what I changed the redirect_uri to it would not work. I am url encoding the redirect_uri.

I decided to do some test, and I can only get it to work with setting the client_id and scope. Without setting the scope or having an empty scope, I get an 'invalid_scope' error (even though the API docs say https://SHOP_NAME.myshopify.com/admin/oauth/authorize?client_id=API_KEY is accepted for basic permissions).

This isn't a huge issue, as I can just detect if there was a 'code' param sent and handle the installation that way, but I'd much rather have it sent to a page specifically setup for handling the install process (Verification, Token Exchange, etc).

Upvotes: 1

Views: 2223

Answers (1)

DudeAmI
DudeAmI

Reputation: 21

Seems I made a silly mistake and the redirect_uri got urlencoded twice.

Upvotes: 1

Related Questions