-
Notifications
You must be signed in to change notification settings - Fork 21
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
Problem with authentification and Inscription #43
Comments
Hi, Sorry for the wait ! What say your logs ? |
In fact, i have no error. But it's don't working. Indeed, I have a neww user with a email NULL and no Username. In the token table, I have a new entry but no new token. In conclusion, my sf_guard_user is like this: id first_name last_name email_address username algorithm salt password is_active is_super_admin last_login created_at updated_at table token: id name token_key token_secret user_id expire params identifier status o_auth_version created_at updated_at my action.class.php: <?php
public function executeIndex(sfWebRequest $request)
{
$this->forward('default', 'module');
}
public function executeConnect(sfWebRequest $request)
{
$this->getUser()->connect('twitter');
#or $this->getUser()->connect('facebook')
}
public function executeFacebook(sfWebRequest $request)
{
$fb_melody = $this->getUser()->getMelody('facebook');
$this->me = $fb_melody->getMe(null, array('fields' => 'picture', 'size' => 'large'));
$this->friends = $fb_melody->getFriends();
$this->form = new FeedForm();
}
public function executeTwitter(sfWebRequest $request)
{
$fb_melody = $this->getUser()->getMelody('twitter');
$this->me = $fb_melody->getMe();
} It's don't working with twitter or facebook. |
and your config in app.yml ? |
Sorry: all:
lang:
default: fr
sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
melody:
create_user: true # to create a user for all melodies
facebook:
key: 202#######
secret: #####72a00da053e9
callback: @api_facebook
scope: [email] #optionnal - http://developers.facebook.com/docs/authentication/permissions
# needed to create an user based on his email_address
user:
username: # the name of a field of sfGuardUser
call: me # api call
path: id # path could be user.object.email for example to retrieve the right inforamtion
prefix: Facebook_
first_name:
call: me
path: first_name
last_name:
call: me
path: last_name
email_address:
call: me
path: email
key: true
twitter:
key: DsYlu#####
secret: ####33mRhwNXM
callback: @api_twitter routing.yml: homepage:
url: /
param: { module: main, action: index }
sf_guard_signin:
url: /login
param: { module: User, action: signin }
sf_guard_signout:
url: /logout
param: { module: User, action: signout }
sf_guard_forgot_password:
url: /forgot_password
param: { module: User, action: ForgotPassword }
sf_guard_register:
url: /register
param: { module: User, action: Register }
api_facebook:
url: /api/facebook
param: { module: api, action: facebook }
api_twitter:
url: /api/facebook
param: { module: api, action: twitter }
api_connect:
url: /api/connect
param: { module: api, action: connect }
melody_facebook_feed:
url: /facebook-feed
param: { module: api, action: facebookFeed }
change_language:
url: /change_language
param: { module: main, action: changeLanguage }
localized_homepage:
url: /:sf_culture/
param: { module: main, action: index }
requirements:
sf_culture: (?:fr|en)
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/* |
Hum... and The flow "works" authorize -> callback ? In the symfony log what have you ? PS: I have updated your comments to have code more readable :p |
Yes, the action file of the api's module is the action.class.php describe in the issue |
Ok. Can you put your logs here :) ? |
Yes of course: Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login) Dec 20 17:48:28 symfony [info] {OAuth} "twitter" call url "https://api.twitter.com/oauth/authorize" with params "array ( Dec 20 17:49:11 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response "" |
Hello Khalezis, I had this same exact problem when I used Windows for dev environment: After some investigation it turned out to be a curl-related issue that OAuth is using for communicating with the Facebook authentication server. Please find some additional details of my investigation here: and here: and here: I fixed the issue here: Hope it's the same problem that you are experiencing. |
Hello, I try this solution, but no it's the same probleme. This is log file: Dec 21 01:43:29 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login) Dec 21 01:43:41 symfony [info] {OAuth} call url "https://graph.facebook.com/oauth/access_token?client_id=202088659876193&client_secret=3639274d9ba3d2578a1a72a00da053e9&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook&code=AQDZFeZiYi5KPyXryf6XxjnFb2Dhu2mKUEkFnlerXjKCo6SxNBuxstnDYSm-2h7Nc8VIK7L7L5r7wx5X1CwQwgwAqVrpKyFH-gW78ygUtpAwdGW0XwbisMgDCi20mk1un1Hi9IjJABoXU8zfV4NwgWfHZvSaLCtrpYLlBpwUvWIhmhgvkPCe5uYuHXx1k97WtX4" with params "client_id=202088659876193&client_secret=3639274d9ba3d2578a1a72a00da053e9&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook&code=AQDZFeZiYi5KPyXryf6XxjnFb2Dhu2mKUEkFnlerXjKCo6SxNBuxstnDYSm-2h7Nc8VIK7L7L5r7wx5X1CwQwgwAqVrpKyFH-gW78ygUtpAwdGW0XwbisMgDCi20mk1un1Hi9IjJABoXU8zfV4NwgWfHZvSaLCtrpYLlBpwUvWIhmhgvkPCe5uYuHXx1k97WtX4" post "" by method "GET" give response "" Dec 21 01:43:42 symfony [err] {OAuth} curl error: error setting certificate verify locations: Dec 21 01:43:42 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response "" Dec 21 01:43:42 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response "" Dec 21 01:43:43 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response "" Dec 21 01:43:44 symfony [info] {OAuth} call url "https://graph.facebook.com/me?fields=picture&size=large" with params "fields=picture&size=large" post "" by method "GET" give response "" Dec 21 01:43:45 symfony [info] {OAuth} call url "https://graph.facebook.com/friends?fields=picture&size=large" with params "fields=picture&size=large" post "" by method "GET" give response "" |
Hello, It seems you still have issues with your certificate: Dec 21 01:43:42 symfony [err] {OAuth} curl error: error setting certificate verify locations: Can you verify your cacert.crt file exists in the aforementioned path? You can grab a copy of the certificate here: Just rename the file to cacert.crt after downloading it. Hope it will solve the problem. |
Hi, Thank you a lot for the solution. Indeed I didn't the file "cacert.crt". Now I have data in my database. Notice: Undefined property: stdClass::$first_name in C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\escaper\sfOutputEscaper.class.php on line 241 Notice: Undefined property: stdClass::$link in C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\escaper\sfOutputEscaper.class.php on line 241 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\helper\UrlHelper.php on line 90 Notice: Trying to get property of non-object in C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 Notice: Trying to get property of non-object in C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 Indeed, in my array this-me I have just the key "picture" |
Because of this : $this->me = $fb_melody->getMe(null, array('fields' => 'picture', 'size' => 'large')); please refer to facebook documentation here : https://developers.facebook.com/docs/reference/api/user/ you have to put in fields parameter all you want |
Oh god I am a supid man. Thank you for the solution. Now it's working. But I have a last question. How I can insert data of the user in a other table. |
You have to implement this by yourself by using redirect_register option |
Hi every one.
I have a problem with the Facebook Connect. Indeed, when i login into Facebook the plugin insert in my database a line with a blank to username's row and email's row.
here is my file routing.yml:
homepage:
url: /
param: { module: main, action: index }
sf_guard_signin:
url: /login
param: { module: sfGuardAuth, action: signin }
sf_guard_signout:
url: /logout
param: { module: sfGuardAuth, action: signout }
sf_guard_forgot_password:
url: /forgot_password
param: { module: sfGuardForgotPassword, action: index }
sf_guard_register:
url: /register
param: { module: sfGuardRegister, action: index }
change_language:
url: /change_language
param: { module: main, action: changeLanguage }
localized_homepage:
url: /:sf_culture/
param: { module: main, action: index }
requirements:
sf_culture: (?:fr|en)
melody_connect:
url: /api
param: { module: api, action: connect }
melody_facebook:
url: /facebook
param: { module: api, action: facebook }
melody_facebook_feed:
url: /facebook-feed
param: { module: api, action: facebookFeed }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
I have 3 modules:
-sfGuard
Do you have an idea for solve this problem?
The text was updated successfully, but these errors were encountered: