jsmrtn / craftagram

Grab Instagram content through the Instagram Basic Display API
Other
14 stars 8 forks source link

Authentication is using @web instead of the web address #3

Closed darylknight closed 4 years ago

darylknight commented 4 years ago

Just looking at setting this up for the first time. I've jumped through all the hoops for Facebook, and when I click Authorise App in Craftagram, I get this:

{"error_type": "OAuthException", "code": 400, "error_message": "Invalid redirect_uri"}

Looking at the URL in the address bar, I think I can see why:

https://www.instagram.com/oauth/authorize?client_id=1216797162045132&redirect_uri=@web/actions/craftagram/default/auth&scope=user_profile,user_media&response_type=code

It's presumably taking @web from my Sites settings but it should be taking the actual URL. If I change the URL in the address bar to the below:

https://www.instagram.com/oauth/authorize?client_id=1216797162045132&redirect_uri=https://mywebsite.com/actions/craftagram/default/auth&scope=user_profile,user_media&response_type=code

Then it will take me to an Instagram styled page asking me if I want to authorise it. If I click yes though, I then get this:

image

bymayo commented 4 years ago

Similar, I have an issue where it's now using $SITE_URL (Guessing you fixed aliases, but not .env vars)

https://www.instagram.com/oauth/authorize?client_id=XXXXXXX&redirect_uri=$SITE_URL/actions/craftagram/default/auth&scope=user_profile,user_media&response_type=code
jsmrtn commented 4 years ago

@bymayo I've just cut a new release that should fix this for you 👍

tobystokes commented 4 years ago

FWIW, i got the same "Invalid redirect_uri" because I had a trailing slash at the end of the baseUrl., meaning the resultant path had a // in it. But I removed it in the Craft settings with no other consequences it seems.