Google and Facebook sign in conflict (PHP) -
i'm trying implement sign in facebook , google in php. work separatly , there no problems.
but when seek them together,it looks facebook api seek connect google authentication.
exactly when click on facebook sign in, have error:
*fatal error:
uncaught exception 'google_authexception' message 'error fetching oauth2 access token, message: 'invalid_grant'' in /myfolder/mamp/htdocs/my_app/google/vendor/google/api-client/src/auth/google_oauth2.php:114 stack trace: #0 /myfolder/mamp/htdocs/my_app/google/vendor/google/api-client/src/google_client.php(131): google_oauth2->authenticate(array, 'aqfjtxtymhmzmez...') #1 /myfolder/mamp/htdocs/my_app/classes/googleauth.php(36): google_client->authenticate('aqfjtxtymhmzmez...') #2 /myfolder/mamp/htdocs/my_app/login.php(9): googleauth->checkredirectcode() #3 {main} thrown in /myfolder/mamp/htdocs/my_app/google/vendor/google/api-client/src/auth/google_oauth2.php on line 114* don't find way create work facebook sign in without conflict checkredirectcode() function goole api.
has had problem or knows how do?
i posted yesterday wasn't real reply got deleted! sorry guys.
just background explanation, adam here uses facebook , google logins of tutorial phpacademy. since utilize same know talking about.
allright!!! so.......! set both (google , fb) uris same target , seek this: in googleauth class in function checkredirectcode() add together check before calling function:
public function checkredirectcode() { if (!isset($_session['facebook'])) { if(isset($_get['code'])) { blablablablabla } homecoming true; } homecoming false; } else { //skip echo "fb session on"; } } it worked me, allow me know if you. don't want phone call function if facebook logged in! :)
php facebook api facebook-graph-api
No comments:
Post a Comment