Closed AnsonSL closed 3 years ago
What version of the plugin are you using? The URL you have copied is a different format to how it presents now. Presumably this is happening when you hit 'Authorise Craft' button?
As an aside, there is a refresh action built in, you can run ./craft craftagram/token
from the CLI to refresh your token, or you can visit the action URL directly https://www.yourwebsite.com/actions/craftagram/default/refresh-token
(note you will need to update to 1.4.2, as this contains a fix for the refresh action)
Thanks @joshua-martin the dev site is running 1.3.1 so I will attempt updating that first and get back to you.
Hi @joshua-martin
{"error_type": "OAuthException", "code": 400, "error_message": "Invalid redirect_uri"}
When I add the site name it directs back to Craft. But then I get the same error as before (line 106 this time).
Undefined property: stdClass::$access_token
This Craft install is a little behind. Could that be the issue?
Thanks!
Have you installed 1.4.2? The issue you have mentioned in 2. should be resolved in that release.
What version of Craft are you running? It looks like there is no value being added to the baseUrl parameter for your primary website. Have you added a baseUrl Settings > Sites, and if so what is it set to?
—
Sent on the move. Please excuse any errors.
From: AnsonSL notifications@github.com Sent: Wednesday, January 6, 2021 10:13:49 PM To: scaramangagency/craftagram craftagram@noreply.github.com Cc: Josh Martin josh@Scaramanga.agency; Mention mention@noreply.github.com Subject: Re: [scaramangagency/craftagram] Error Refreshing the Access Token (#35)
Hi @joshua-martinhttps://github.com/joshua-martin
{"error_type": "OAuthException", "code": 400, "error_message": "Invalid redirect_uri"}
When I add the site name it directs back to Craft. But then I get the same error as before (line 106 this time).
Undefined property: stdClass::$access_token
This Craft install is a little behind. Could that be the issue?
Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/scaramangagency/craftagram/issues/35#issuecomment-755747658, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAM5Z3LAAGSZFB4GF5SMU7TSYTOB3ANCNFSM4VXZBP2A.
@joshua-martin Thanks for your help. Updating everything has helped, and the issue was the baseUrl setting was set to blank for the primary domain on a multilingual site.
Question: does the CRON job refresh tokens for all sites? /usr/bin/wget -q https://sitename.com/actions/craftagram/default/refresh-token >/dev/null 2>&1
No worries, glad you got it sorted. Yes, the refresh job will attempt to run against every site. If there is no access token defined for a site it will skip.
Hi, just attempted refreshing the access token for the first time and I'm running into an issue.
When I go to refresh the token the redirect_uri doesn't include the domain despite the domain being included in Valid OAuth Redirect URIs in the Facebook developer panel.
&redirect_uri=/actions/craftagram/default/auth&scope=user_profile,user_media&response_type=code
I get around this by modifying the query string above and adding the domain of the site to redirect_uri&redirect_uri=mydomain.com/actions/craftagram/default/auth&scope=user_profile,user_media&response_type=code
Once I press return I'm shown the Instagram screen asking me to confirm that I'd like to continue using my previous settings.
Instagram then redirects back to the auth action on my website (
mydomain.com/actions/craftagram/default/auth?code={token}
)Any suggestions?