Announcement

#16 2013-03-07 01:53:56

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: error on oauth facebook

I said Site URL not App Name...

which error ? where ? (Facebook configuration interface, Piwigo...)

Offline

 

#17 2013-03-07 01:59:46

phantomracer
Member
2013-03-06
30

Re: error on oauth facebook

yup.. realized my error.. changed the url as well with the slash..didn't change anything...

should the url contain the directory where piwigo is?

http://www.seeberg.com/piwigo/ or
http://www.seeberg.com/

it is currently
http://www.seeberg.com/piwigo/

Last edited by phantomracer (2013-03-07 02:01:05)

Offline

 

#18 2013-03-07 02:02:54

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: error on oauth facebook

as written on the help : the full URL for "Site URL" and the domain name for "App domains"

I've no idea, perhaps a strange configuration of your server, of facebook, or something between them

Offline

 

#19 2013-03-07 12:04:41

Skybly
Guest

Re: error on oauth facebook

This happens when PHP error reporting is set to the "notice" level. You can either change the error level, or edit the auth.php file in the oAuth plugin folder the following way:

change

Code:

if ($provider == 'OpenID')
  {
    $params['openid_identifier'] = $_GET['openid_identifier'];
  }

to

Code:

if ($provider == 'OpenID')
  {
    $params['openid_identifier'] = $_GET['openid_identifier'];
  } else {
    $params = array();
  }
 

#20 2013-03-07 12:12:29

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: error on oauth facebook

again : this is already fixed in version 1.0.0

Offline

 

#21 2013-03-07 12:15:16

Skybly
Member
Germany
2013-03-07
2

Re: error on oauth facebook

Oops, sorry. I just realized that - Piwigo doesn't notify me of the new version either. I shall read more closely next time :)

Offline

 

#22 2013-03-07 12:25:57

phantomracer
Member
2013-03-06
30

Re: error on oauth facebook

I have it set up as instructed. must be my provider (Yahoo) I guess. have had other programs not work.

will be moving it off yahoo at some point.

Offline

 

#23 2013-03-07 12:31:09

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: error on oauth facebook

I had issues with Yahoo, the most important is step 6

Once the application is registered update the permissions : set Contacts as Read and Social Directory as Read Public

Offline

 

#24 2013-03-07 15:02:15

phantomracer
Member
2013-03-06
30

Re: error on oauth facebook

i dont see a step 6 on the FB login help.

It is probably moot because Yahoo is most likely messing something up somewhere.  Have tried dozens of photo album programs, all failed, usually at installation. Surprised Piwigo works..and works well. If this is the only thing that doesn't, I am fine with it. Great application!


1    Go to https://developers.facebook.com/apps and create a new application
2   Fill out any required fields such as the application name and description
3   Set the application type to Website with facebook authentication
4 Put your website domain in the Site Url, App Domains fields. It should match with the current hostname: http://seeberg.com/piwigo/
5    Once you have registered, copy and past the created application credentials into this setup page

Offline

 

#25 2013-03-27 15:05:01

zyclo
Member
2008-01-27
4

Re: error on oauth facebook

Hello,
i have the same message, error code 0..
should i have to change the something in the  notice code list ? as i saw in another thread ? :
This happens when PHP error reporting is set to the "notice" level. You can either change the error level, or edit the auth.php file in the oAuth plugin folder the following way:

change
Code:

if ($provider == 'OpenID')
  {
    $params['openid_identifier'] = $_GET['openid_identifier'];
  }
to
Code:

if ($provider == 'OpenID')
  {
    $params['openid_identifier'] = $_GET['openid_identifier'];
  } else {
    $params = array();
  }


Thanks for your help

Offline

 

#26 2013-03-27 17:19:13

paradigm
Member
2011-06-09
5

Re: error on oauth facebook

I'm also having the same error "Authentication cancelled" with the latest oAuth version but for different reasons.

Our Piwigo website is only available to internal addresses, so I'm not sure if that's causing problems.
This is how it's currently set up:
- FB Site URL https://photos.company.lan:443/
- Website is HTTPS self-signed (trusted company CA Authority)
- Server is running Apache 2 with PHP 5.4.13 + APC (error_log reporting only)
- Piwigo is version 2.5.0 and oAuth version 1.0.1

When clicking on the FB login icon, this is what happens on the client:
(1) A request is made to https://photos.company.lan/plugins/oAut … 4399245380
(2) Redirected to https://photos.company.lan/plugins/oAut … 1364399253
(3) Redirect is made to Facebook via https://www.facebook.com/dialog/oauth?c … b282######
(4) Upon FB authentication & authorisation the Auth is sent to https://photos.company.lan/plugins/oAut … 1ULAA6#_=_
(5) Finally the request is made (which ultimately fails) to https://photos.company.lan/plugins/oAut … nit_auth=1

The last request with openid_identifier being empty is obviously the cause for the "Authentication cancelled" error, but I can't see why hybridauth is failing to authenticate in the first place. 
Have I missed something?

I've checked the time on the server, FB + oAuth settings and more multiple times, so now I'm at a loss.

Kind regards,
David

Offline

 

#27 2013-03-27 18:15:13

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: error on oauth facebook

the empty openid_identifier is NOT the cause, as Facebook is not a OpenId provider

I think the only cause is that Facebook can't contact your host (or the reverse) to check the authentification

Offline

 

#28 2013-09-28 16:15:40

paradigm
Member
2011-06-09
5

Re: error on oauth facebook

Authentication still only fails for Facebook.

Google, Twitter, Tumblr etc all work fine.

Facebook doesn't even attempt to connect to my server for pre authentication.  My other theory is it fails because Facebook won't accept my valid StartCom SSL Certificate.  Probably should tcpdump to see if this is actually true.

Basically I've given up on allowing Facebook authentication. 
I just get my users to choose another authentication provider from the list of other options like Google.

Last edited by paradigm (2013-09-28 16:35:12)

Offline

 

#29 2013-10-13 21:48:24

paradigm
Member
2011-06-09
5

Re: error on oauth facebook

Well I knew my problem wasn't just me. 
Here's the bug fix for the Facebook problem I was having.  It's all to do with the CSRF checks in the HybridAuth library + the URL generated by Piwigo's get_absolute_root_url() function.

The problem:
The URL https://example.com:443/test is considered different to https://example.com/test even though they are the same website; the only difference being the URL port number.

The HybridAuth library that communicates with Facebook fails with a "CSRF state token does not match one provided" error even when authentication is actually successful.  This means you get an "Authentication cancelled" message even if it's a CSRF problem, not a Facebook problem.

The cause:
Under Piwigo include/functions_url.inc.php the get_absolute_root_url() function doesn't remove the default port number of 443 for HTTPS domains.  The oAuth plugin currently uses this Piwigo to generate the Facbook callback URLs.

Solution:
Edit the Piwigo functions_url.inc.php file and change the line:

if ($_SERVER['SERVER_PORT'] != 80)

to

if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)

Another solution is to modify the plugin/oAuth/main.inc.php file to use another function to define OAUTH_PUBLIC (this has been my approach). 
This is a neater fix and won't break on Piwigo updates - but I'll leave this to the oAuth maintainer.

The best thing I did to finding the cause was fixing the annoying plugin/oAuth/auth.php error message 5 of "Authentication cancelled"!  I highly recommend you change this line:

$template->assign('ERROR', l10n('Authentication cancelled')); break;

to:

$template->assign('ERROR', l10n($e->getMessage())); break;

No more Facebook authentication problems when using SSL. *sighs with relief*
David

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact