Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook Authentication Register throws error #4354

Closed
ounziw opened this issue Sep 7, 2016 · 7 comments
Closed

Facebook Authentication Register throws error #4354

ounziw opened this issue Sep 7, 2016 · 7 comments
Labels
Status:Available Reviewed issue, it’s real, we’d review a pull request. Type:Enhancement A need for something new.

Comments

@ounziw
Copy link
Contributor

ounziw commented Sep 7, 2016

In /dashboard/system/registration/authentication,

  • enables facebook authentication
  • check "Allow automatic registration"

When a new user tries to register via faceook, c5 returns a following error.

An exception occurred while executing 'insert into Users (uName, uEmail, uPassword, uIsValidated, uDateAdded, uLastPasswordChange, uIsFullRecord, uDefaultLanguage, uIsActive) values (?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["", null, "xxxxxxxxxx.", 1, "2016-08-26 17:07:39", "2016-08-26 17:07:39", 1, null, 1]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uEmail' cannot be null

Facebook document says;
https://developers.facebook.com/docs/facebook-login/permissions#refe...
Note, even if you request the email permission it is not guaranteed you will get an email address. For example, if someone signed up for Facebook with a phone number instead of an email address, the email field may be empty.

Maybe we need to update Facebook Authentication program to allow a user to fill in his/her email. Twitter Authentication process asks a user to fill in his/her email.

@aembler aembler added Type:Enhancement A need for something new. Status:Available Reviewed issue, it’s real, we’d review a pull request. priority:love to have labels Sep 13, 2016
@aembler aembler added this to the 8.1 milestone Sep 13, 2016
@w3development-kn
Copy link

w3development-kn commented Dec 22, 2016

I don´t think that this is a "love to have"-priority. That´s a bug which makes social login with facebook not possible. This should get adressed more quickly.

@w3development-kn
Copy link

I´m not quite sure how the vendors are handled in C5 but the UserData-Extractor from oryzone is outdated. This fixes the error:

/concrete/vendor/oryzone/oauth-user-data/src/OAuth/UserData/Extractor/Facebook.php
Line 28:

Instead of
const REQUEST_PROFILE = '/me';

go with:
const REQUEST_PROFILE = '/me?fields=name,email';

@aembler
Copy link
Member

aembler commented Jan 10, 2017

This seems like an outstanding issue with the userdata-extractor library and it doesn't appear to be fixed even though there's an open issue (that's been open since early 2016); should we fork this library @KorvinSzanto ?

@aembler aembler modified the milestones: 8.2, Future Feb 10, 2017
@PedroLucasnet
Copy link

As far as I could test 8.2.1 solved this for most Members but the same error still occurs for some.
I'm happy to provide details.

@PedroLucasnet
Copy link

@aembler , could I please request that this is put in queue for the near future?
Many thanks!

@aembler
Copy link
Member

aembler commented Sep 29, 2017

It is already there – we'd be happy to accept pull requests for this. It's not personally high on our list of items to work on but I imagine it'll be fixed at some point – probably by someone who needs the functionality.

This was referenced Oct 5, 2017
@savansakshi
Copy link

savansakshi commented Oct 14, 2017

Hello everyone,

Finally, i found fb login issue solution sharing here.

I was using facebook 5.8 and still found fb login issue. I found one issue which is related to token read of facebook and other issue the url as posted by @micrdy .

Below is 2 changes which i did after that fb login started working for me

1. concrete5-8.1.0\concrete\vendor\lusitanian\oauth\src\OAuth\OAuth2\Service\Facebook.php

IN FUNCTION parseAccessTokenResponse($responseBody)

replace
parse_str($responseBody, $data);

With
$data=json_decode($responseBody,true);

2. concrete5-8.1.0\concrete\vendor\oryzone\oauth-user-data\src\OAuth\UserData\Extractor\Facebook.php

Instead of
const REQUEST_PROFILE = '/me';

go with:
const REQUEST_PROFILE = '/me?fields=name,email';

@aembler aembler closed this as completed Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Available Reviewed issue, it’s real, we’d review a pull request. Type:Enhancement A need for something new.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants