jsmrtn / craftagram

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

Invalid redirect uri cased by 500 error thrown by DefaultController->actionAuth() #29

Closed davcevski closed 4 years ago

davcevski commented 4 years ago

Hey guys,

Having trouble to refresh my token. Pinging actions/craftagram/default/auth returns this error:

Undefined index: query in .../htdocs/vendor/scaramangagency/craftagram/src/controllers/DefaultController.php:51

The query argument is indeed empty. Running

"craftcms/cms": "3.5.12.1" and crafttagram 1.2.6

Any clues?

jsmrtn commented 4 years ago

@davcevski That isn't the refresh token URL. actions/craftagram/default/refresh-token https://github.com/scaramangagency/craftagram#keeping-your-token-active

davcevski commented 4 years ago

Sorry if I was not clear. Both redirect url and refresh token are retrieving 500.

The error I am getting from instagram is

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

Just because the /auth endpoint returns 500. Same with refresh-token.

jsmrtn commented 4 years ago
  1. At what point are you getting this error? When you are adding your ID and Secret and hitting Authorise Craft? Or have you previously Authorised the application and it is not now allowing you to refresh the token?
  2. What is your baseUrl set to in Craft, and what URL have you added at step 6 in your app setup in Facebook?

This error usually dictates the URL you have added in the setup of the application in Facebook doesn't match the URL in Craft.

davcevski commented 4 years ago

I was missing www in the url 🤦 . Sorry for the confusion, works now I was able to refresh the token. At some point during these 60 days I added www to the craft domain and forgot about it.