1

I am getting an error with oauth (1.0.79) when using Facebook:

Required option not passed: access_token Array ( [{"error":{"message":"Error_validating_verification_code__Please_make_sure_your_redirect_uri_is_identical_to_the_one_you_used_in_the_OAuth_dialog_request","type":"OAuthException","code":100,"fbtrace_id":"A2ThFvRVsAZ"}}] => )

Facebook is changing the url entered and replacing the /'s in the p=actions/oauth/connect part of the redirect URI with ASCII characters %2F p=actions%2Foauth%2Fconnect which I assume is then not matching the 2 uri's causing the above error.

Is this the issue? Is there a workaround? Or is this a tweak that needs to be made to oauth?

Cheers

1
  • You are correct that it is an encoding error. I have reported it to Dukt here: github.com/dukt/craft-oauth/issues/18. In the mean time, you can modify oauth/providers/Facebook.php and just hardcode the redirectUrl with the last two forward-slashes replaced with %2F. Mar 8 '16 at 1:15
1

You can set usePathInfo = true in your Craft general settings to force Craft to use PATH_INFO to generate URLs.

https://craftcms.com/docs/config-settings#usePathInfo

Dukt OAuth should now show you a redirect URI without a query string (Facebook doesn’t like slashes in the query string and automatically encodes them) and you should be able to make the URIs match exactly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.