When I want to add an FB App, then

"The parameter redirect_uri is required"

here is the urls

https://www.facebook.com/dialog/oauth?client_id=191886994259986&state=7f...

do not see where the problem is. Redirect URI parameter is in the URL.

Comments

afi_amouzou’s picture

Assigned: Unassigned » afi_amouzou
StatusFileSize
new15.24 KB

Hallo bennos,

did you have your Domain in the "Apps Domains" Settings in your Facebook App?

See the Screenshot.

bennos’s picture

hm,
When I add an domain in the field, I must select something below, but what?

Got it working with twitter.
Added my domain in the facebook app and checked "Website with Facebook Login" and added my root url.
But the error is the same.

hmmm

bennos’s picture

did not get it, but I am close.

Your url "authenticate" in the UI is not right.

Replacing the "&" with "&" . Facebook does not handle it.
https://www.facebook.com/dialog/oauth?client_id=355429237893095&state=74d4a09c40130e5d5b4936132754c2d0&redirect_uri=http%3A%2F%2Falpha.domain.com%2Fsocialmedia_importer%2Fresponse_handler&scope=user_birthday%2Cread_stream

Whe I write the "&" the url manually, then facebook accept the url, but it does not authenticate it
Next error:
The Application can not be authenticated. Check your application Settings

looks like an Oauth problem here.

afi_amouzou’s picture

I replace the "&" with "&". http_build_query($array); gives "&" to some servers.
The change is in the beta3 release. Do an Update to see if your problem is solved.

Best Regards.

bennos’s picture

Hey
thx for the fix.
The redirect works now, but can still not get an authentification with facebook.
Error message: The Application can not be authenticated. Check your application Settings.

I get to the facebook site an authenticate. After that I get back to drupal and get the error message above.
Looks like the Oauth token get not to drupal and the oauth module.
I looked in the DB tables and nothing there.

Hosting is Aegir on Nginx (BOA https://drupal.org/project/barracuda).

Twitter Auth works fine. Just Facebook that makes trouble.
So the Aegir and Nginx does not block something (header oder access).

You help would be great to socialmedia_importer up an running with facebook.

thx
bennos

afi_amouzou’s picture

StatusFileSize
new2.45 KB

Hi,

Error message: The Application can not be authenticated. Check your application Settings.

It is possible that you don' t get a code from Facebook. To help with the debugging, follow this steps and upload the logfile content:

  • Install the file logger module: File Logger. Enable and set the logfile in admin/config/development/flog. You need to set the right permissions for the logfile. See the Documentation in the Module Page.
  • Apply the patch.
  • Check the content of the logfile. To get an access token, you need to get a code from Facebook.
    e.g.
    array (
     [code] => AQA29pgcvlCKDY2SFL5XuPj...
     [state] => ujekei...
    )

Best Regards.
afi_amouzou

bennos’s picture

patch applied.
file logger module installed.

cleared cache and registry.
tried to authenticate

here is the ouput form the file log

 [2013-07-18 00:04:06] Array
(
    [q] => socialmedia_importer/response_handler
    [code] => AQCVhXWcak9ml46MxDFrKoS8ru3VxQVtHh1XFMjKUII-VaWz7Ww1IXEuKYaWyB-Eo2bairrpni4qEqHuSj4R28tPirSnZR80W-LAp4PdaL97sYWGgd6y71BbamiIUSJ96gY00sf_npX9MXS4xNW5FHWSITWla1NhptTbeEOGVClSxAUsSTIO6P0DUQYEEwDU9fj2SfsIQERHtpNXC8N1XxaaRIQ_PCU0Vzn5JD0Pq4DhPSpyJkd8bY1WlBEAXIsMJxfYy6CRzt_Hm463bbXgjXsx3FhYTAIDzcpFy4dyd8vdm_KtOrWuSIhuwGgyBJkd_f4
    [state] => cb0aaf0b65b33b0cf4165a4a45bd55ab
)

Looks like there comes the token from facebook.
Also looked at the database tables. no access token saved.

afi_amouzou’s picture

StatusFileSize
new4.43 KB

Hi,
I need more debug infos to anderstand why you can not get access token with the code or why the access token is not saved. I provide a new patch with more log entry to get more infos. Post the logfile data and the Drupal Messages.

Thanks
Best Regards.
afi_amouzou

bennos’s picture

hey
applied patch to the beta3 version.

I tried to autenticate an fb-app that has been created before.

I added also a new app. Redirect on the screen to the FB page works, but see the log file entry's below.

[2013-07-18 11:09:41] (Session_state_dialogurl) 6078e3d51839032f37805ac2281e32f6
[2013-07-18 11:09:41] (Request_array_start) Array
(
    [q] => socialmedia_importer/response_handler
    [code] => AQDf1YT-6F-Rci1YzgosfI2tuovCoScWBpo5uNH552fxl78LAssqGkJ6Oft2CN3jF5Qk0SEjiMHGzz_E9X0HX4DM1_Ui8PuI7D0HP-1KOmL1JgeOJ7Z6ETPSP8gfzFv6HoUTyEX9MtPzsxwVYMtB8crbsXM08QozxoHyL_yzTOKVVAzx_hYf22Qn2V7JsYmPOpVTPdDzEd2WHdEBHDsSDfnkhqIhDRkqCEhk9_s2Lx5T9jgwQQh6l_AhNzeV1siXcRYfL1Vn5oOSGTOu7hcG0zahffja7egHx4aHmSm0rShJKWC6IFh0D5L8RYG8FqVtvZs
    [state] => 6078e3d51839032f37805ac2281e32f6
)

[2013-07-18 11:09:41] (Session_array_state_start) 6078e3d51839032f37805ac2281e32f6
[2013-07-18 11:09:41] (token_url) https://graph.facebook.com/oauth/access_token?client_id=485600934857000&client_secret=6f73e0df5d55f4e2c50c020250bc85f5&redirect_uri=http%3A%2F%2Fsocial.two.om-manager.com%2Fsocialmedia_importer%2Fresponse_handler&code=AQDf1YT-6F-Rci1YzgosfI2tuovCoScWBpo5uNH552fxl78LAssqGkJ6Oft2CN3jF5Qk0SEjiMHGzz_E9X0HX4DM1_Ui8PuI7D0HP-1KOmL1JgeOJ7Z6ETPSP8gfzFv6HoUTyEX9MtPzsxwVYMtB8crbsXM08QozxoHyL_yzTOKVVAzx_hYf22Qn2V7JsYmPOpVTPdDzEd2WHdEBHDsSDfnkhqIhDRkqCEhk9_s2Lx5T9jgwQQh6l_AhNzeV1siXcRYfL1Vn5oOSGTOu7hcG0zahffja7egHx4aHmSm0rShJKWC6IFh0D5L8RYG8FqVtvZs
[2013-07-18 11:09:42] (access_token_response_getAccessToken) {"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
[2013-07-18 11:09:42] 
[2013-07-18 11:09:42] 
[2013-07-18 11:09:42] (access_token) 
[2013-07-18 11:09:42] (Session_array_state_end) 6078e3d51839032f37805ac2281e32f6
[2013-07-18 11:09:42] (access_token_error) Can not get access token from Facebook
[2013-07-18 11:12:04] (Session_state_dialogurl) 066407b67716ca6f0c0da4fcd54f033c
[2013-07-18 11:12:11] (Request_array_start) Array
(
    [q] => socialmedia_importer/response_handler
    [code] => AQA_-sQp0ttOsT1Coxf7UUCEOtK6WmmZPNiddKYDrJuf6T_s5nhYyCeFQKQvw9EYFP4U0NpRuWtoEs1BDaHeYMcfY8onC9YtHYestpKf3VxQLZuvKfqLqgjy6e4HPitildbqkvUXzU5PxhoG2JLLFlBKxE6Gaxxmz3oFAz3EL9p_YUEGrxqRB0I1ZlJZkXIwu1hScpRAVNf9m1ykQtfPzvblKhkHH_BtBPv_DvnaIzBLxSCAVKNw3COdVgpUeALyCvKHrDVHorAMMjp46kHQzS5c3TF6JDKYHVrzoGQY5YipVNs3KvCX5xgyd8uYPNSauKU
    [state] => 066407b67716ca6f0c0da4fcd54f033c
)

[2013-07-18 11:12:11] (Session_array_state_start) 066407b67716ca6f0c0da4fcd54f033c
[2013-07-18 11:12:11] (token_url) https://graph.facebook.com/oauth/access_token?client_id=182633398573244&client_secret=40c269cf132d0b1e302cb636692e8241&redirect_uri=http%3A%2F%2Fsocial.two.om-manager.com%2Fsocialmedia_importer%2Fresponse_handler&code=AQA_-sQp0ttOsT1Coxf7UUCEOtK6WmmZPNiddKYDrJuf6T_s5nhYyCeFQKQvw9EYFP4U0NpRuWtoEs1BDaHeYMcfY8onC9YtHYestpKf3VxQLZuvKfqLqgjy6e4HPitildbqkvUXzU5PxhoG2JLLFlBKxE6Gaxxmz3oFAz3EL9p_YUEGrxqRB0I1ZlJZkXIwu1hScpRAVNf9m1ykQtfPzvblKhkHH_BtBPv_DvnaIzBLxSCAVKNw3COdVgpUeALyCvKHrDVHorAMMjp46kHQzS5c3TF6JDKYHVrzoGQY5YipVNs3KvCX5xgyd8uYPNSauKU
[2013-07-18 11:12:11] (access_token_response_getAccessToken) {"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
[2013-07-18 11:12:11] 
[2013-07-18 11:12:11] 
[2013-07-18 11:12:11] (access_token) 
[2013-07-18 11:12:11] (Session_array_state_end) 066407b67716ca6f0c0da4fcd54f033c
[2013-07-18 11:12:11] (access_token_error) Can not get access token from Facebook

Looks like the token can not get, because the url is encoded.

afi_amouzou’s picture

StatusFileSize
new6.79 KB

I Provide a new Patch to solve the possible encoding Problems in the code. Apply the new Patch.
If you still have errors, post the logs and the Facebook Application Settings.

bennos’s picture

Status: Active » Reviewed & tested by the community

last patch works like a charm.

authentification of an added app works.
also added a new FB app and it works.
here is the file log.

[2013-07-19 16:53:40] (Session_state_dialogurl) 91f90c78685f46657215a9a60c9baf48
[2013-07-19 16:53:45] (Request_array_start) Array
(
    [q] => socialmedia_importer/response_handler
    [code] => AQCcG1yDMBkj_v_uGRyJmzdnc70JzNLZie-OSztsi1faxVtd6hSYQdpSR-cEoqmQ2jZVwtyJEbbvjfeasGv66Bcdz9fYfk9ZwpTxW5s33b0o-N2roYdqyy0p_iuJvim6IHVQqsOGLaZEqk7EtlM11lYemEkoDOR1WT7thLu6zZsoxhf6FOlANDlTyMcZ7XBsI1EHI3A2D_fJdNrQ5wdWBHn9Ig5Fl15aG_C6_ZNrFW_INtonmPXC4PgcRLAbLdyVXC-OCYX1D8W6TqK2XwqxGWrOoOq0gfnUmTVruFdl5XqQp64jAn1f_aQGWvYI6hEtW2k
    [state] => 91f90c78685f46657215a9a60c9baf48
)

[2013-07-19 16:53:45] (Session_array_state_start) 91f90c78685f46657215a9a60c9baf48
[2013-07-19 16:53:45] (token_url) https://graph.facebook.com/oauth/access_token?client_id=182633398573244&client_secret=40c269cf132d0b1e302cb636692e8241&redirect_uri=http%3A%2F%2Fsocial.two.om-manager.com%2Fsocialmedia_importer%2Fresponse_handler&code=AQCcG1yDMBkj_v_uGRyJmzdnc70JzNLZie-OSztsi1faxVtd6hSYQdpSR-cEoqmQ2jZVwtyJEbbvjfeasGv66Bcdz9fYfk9ZwpTxW5s33b0o-N2roYdqyy0p_iuJvim6IHVQqsOGLaZEqk7EtlM11lYemEkoDOR1WT7thLu6zZsoxhf6FOlANDlTyMcZ7XBsI1EHI3A2D_fJdNrQ5wdWBHn9Ig5Fl15aG_C6_ZNrFW_INtonmPXC4PgcRLAbLdyVXC-OCYX1D8W6TqK2XwqxGWrOoOq0gfnUmTVruFdl5XqQp64jAn1f_aQGWvYI6hEtW2k
[2013-07-19 16:53:45] (access_token_response_getAccessToken) access_token=CAACmGqbYmLwBAHZBNqwgepEaXk0KOqqF973KUZC3gtTgZCtbZCd968pyv1NtF1oSWFAiy7hg1chCTjDZC4ZAPZBBP6h2Alkybc0cZC2RyL92XXZC6JbfusV82b3CMjZBzL0cuIRZBEy1D3rZAWnZBWGVUoZCRLyXhUSDzhc0wZD&expires=5183999
[2013-07-19 16:53:45] (access token) CAACmGqbYmLwBAHZBNqwgepEaXk0KOqqF973KUZC3gtTgZCtbZCd968pyv1NtF1oSWFAiy7hg1chCTjDZC4ZAPZBBP6h2Alkybc0cZC2RyL92XXZC6JbfusV82b3CMjZBzL0cuIRZBEy1D3rZAWnZBWGVUoZCRLyXhUSDzhc0wZD

I looked also in the database table and the token is saved.
thx for your work.

changing the status to rtbc,

afi_amouzou’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Fix will be in beta4 and dev Version.