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

Problem with authentification and Inscription #43

Closed
Khalezis opened this issue Dec 12, 2011 · 15 comments
Closed

Problem with authentification and Inscription #43

Khalezis opened this issue Dec 12, 2011 · 15 comments

Comments

@Khalezis
Copy link

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:

  • api
  • main
    -sfGuard

Do you have an idea for solve this problem?

@chok
Copy link
Owner

chok commented Dec 20, 2011

Hi,

Sorry for the wait !

What say your logs ?

@Khalezis
Copy link
Author

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
1 NULL NULL sha1 NULL NULL 1 0 2011-12-20 00:30:41 2011-12-20 00:30:41 2011-12-20 00:30:41

table token:

id name token_key token_secret user_id expire params identifier status o_auth_version created_at updated_at
1 facebook NULL NULL 1 NULL NULL NULL access 2 2011-12-20 00:30:41 2011-12-20 00:30:41

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.

@chok
Copy link
Owner

chok commented Dec 20, 2011

and your config in app.yml ?

@Khalezis
Copy link
Author

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/*

@chok
Copy link
Owner

chok commented Dec 20, 2011

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

@Khalezis
Copy link
Author

Yes, the action file of the api's module is the action.class.php describe in the issue

@chok
Copy link
Owner

chok commented Dec 20, 2011

Ok. Can you put your logs here :) ?

@Khalezis
Copy link
Author

Yes of course:

Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:48:04 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:48:04 symfony [info] {sfPatternRouting} Match route "homepage" (/) for / with parameters array ( 'module' => 'main', 'action' => 'index',)
Dec 20 17:48:04 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:48:04 symfony [info] {sfFilterChain} Executing filter "sfBasicSecurityFilter"
Dec 20 17:48:04 symfony [info] {sfBasicSecurityFilter} Action "main/index" requires authentication, forwarding to "User/signin"
Dec 20 17:48:04 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:48:04 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:48:04 symfony [info] {UserActions} Call "UserActions->executeSignin()"
Dec 20 17:48:04 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/signinSuccess.php"
Dec 20 17:48:04 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/_signin_form.php"
Dec 20 17:48:04 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:48:04 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:48:04 symfony [info] {main} Call "main->executeLanguage()"
Dec 20 17:48:05 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 20 17:48:05 symfony [info] {sfWebResponse} Send status "HTTP/1.1 401 Unauthorized"
Dec 20 17:48:05 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Configuration 245.87 ms (13)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Factories 222.81 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Action "User/signin" 61.98 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} View "Success" for "User/signin" 391.48 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Partial "User/_signin_form" 72.60 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Component "main/language" 78.95 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebDebugLogger} Partial "main/_language" 40.52 ms (1)
Dec 20 17:48:05 symfony [info] {sfWebResponse} Send content (45383 o)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:48:23 symfony [info] {sfPatternRouting} Match route "homepage" (/) for / with parameters array ( 'module' => 'main', 'action' => 'index',)
Dec 20 17:48:23 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:48:23 symfony [info] {sfFilterChain} Executing filter "sfBasicSecurityFilter"
Dec 20 17:48:23 symfony [info] {sfBasicSecurityFilter} Action "main/index" requires authentication, forwarding to "User/signin"
Dec 20 17:48:24 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:48:24 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:48:24 symfony [info] {UserActions} Call "UserActions->executeSignin()"
Dec 20 17:48:24 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/signinSuccess.php"
Dec 20 17:48:24 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/_signin_form.php"
Dec 20 17:48:24 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:48:24 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:48:24 symfony [info] {main} Call "main->executeLanguage()"
Dec 20 17:48:24 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 20 17:48:24 symfony [info] {sfWebResponse} Send status "HTTP/1.1 401 Unauthorized"
Dec 20 17:48:24 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Configuration 311.57 ms (13)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Factories 447.92 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Action "User/signin" 59.84 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} View "Success" for "User/signin" 403.59 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Partial "User/_signin_form" 89.72 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Component "main/language" 64.63 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebDebugLogger} Partial "main/_language" 44.60 ms (1)
Dec 20 17:48:24 symfony [info] {sfWebResponse} Send content (45418 o)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:48:27 symfony [info] {sfPatternRouting} Match route "api_connect" (/api/connect) for /api/connect with parameters array ( 'module' => 'api', 'action' => 'connect',)
Dec 20 17:48:27 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:48:27 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:48:27 symfony [info] {apiActions} Call "apiActions->executeConnect()"
Dec 20 17:48:28 symfony [info] {OAuth} call url "https://api.twitter.com/oauth/request_token" with params "oauth_callback=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ftwitter&oauth_consumer_key=DsYlunLRFJskMpeR6JsuVA&oauth_nonce=5e55665312c24871871d2da4417a3d56&oauth_signature=S%2BiGDSAazVDrSa0qv%2BL6xSUxiKI%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1324399707&oauth_version=1.0" post "" by method "POST" give response ""
Dec 20 17:48:28 symfony [err] {OAuth} access token failed - twitter returns Array
(
)

Dec 20 17:48:28 symfony [info] {OAuth} "twitter" call url "https://api.twitter.com/oauth/authorize" with params "array (
'oauth_token' => NULL,
)"
Dec 20 17:48:28 symfony [info] {sfFrontWebController} Redirect to "https://api.twitter.com/oauth/authorize?"
Dec 20 17:48:28 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found"
Dec 20 17:48:28 symfony [info] {sfWebResponse} Send header "Location: https://api.twitter.com/oauth/authorize?"
Dec 20 17:48:28 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Configuration 205.26 ms (8)
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Factories 385.65 ms (1)
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Action "api/connect" 827.47 ms (1)
Dec 20 17:48:28 symfony [info] {sfWebResponse} Send content (111 o)
Dec 20 17:48:28 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 105 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:48:28 symfony [err] {sfRenderException} The template "connectSuccess.php" does not exist or is unreadable in "".
Dec 20 17:48:28 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:48:28 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Configuration 226.58 ms (9)
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Factories 385.65 ms (1)
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} Action "api/connect" 1655.97 ms (2)
Dec 20 17:48:28 symfony [info] {sfWebDebugLogger} View "Success" for "api/connect" 156.27 ms (1)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:49:02 symfony [info] {sfPatternRouting} Match route "homepage" (/) for / with parameters array ( 'module' => 'main', 'action' => 'index',)
Dec 20 17:49:03 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:49:03 symfony [info] {sfFilterChain} Executing filter "sfBasicSecurityFilter"
Dec 20 17:49:03 symfony [info] {sfBasicSecurityFilter} Action "main/index" requires authentication, forwarding to "User/signin"
Dec 20 17:49:03 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:49:03 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:49:03 symfony [info] {UserActions} Call "UserActions->executeSignin()"
Dec 20 17:49:03 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/signinSuccess.php"
Dec 20 17:49:03 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/_signin_form.php"
Dec 20 17:49:03 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:49:03 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:49:03 symfony [info] {main} Call "main->executeLanguage()"
Dec 20 17:49:03 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 20 17:49:03 symfony [info] {sfWebResponse} Send status "HTTP/1.1 401 Unauthorized"
Dec 20 17:49:03 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Configuration 231.25 ms (13)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Factories 269.61 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Action "User/signin" 42.46 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} View "Success" for "User/signin" 334.98 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Partial "User/_signin_form" 61.50 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Component "main/language" 48.74 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebDebugLogger} Partial "main/_language" 41.27 ms (1)
Dec 20 17:49:03 symfony [info] {sfWebResponse} Send content (45386 o)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:49:06 symfony [info] {sfPatternRouting} Match route "api_connect" (/api/connect) for /api/connect with parameters array ( 'module' => 'api', 'action' => 'connect',)
Dec 20 17:49:06 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:49:06 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:49:06 symfony [info] {apiActions} Call "apiActions->executeConnect()"
Dec 20 17:49:07 symfony [info] {OAuth} "facebook" call url "https://graph.facebook.com/oauth/authorize" with params "array (
'scope' => 'email',
'client_id' => '202088659876193',
'redirect_uri' => 'http://altezis.localhost/frontend_dev.php/access/facebook',
)"
Dec 20 17:49:07 symfony [info] {sfFrontWebController} Redirect to "https://graph.facebook.com/oauth/authorize?scope=email&client_id=202088659876193&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook"
Dec 20 17:49:07 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found"
Dec 20 17:49:07 symfony [info] {sfWebResponse} Send header "Location: https://graph.facebook.com/oauth/authorize?scope=email&client_id=202088659876193&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook"
Dec 20 17:49:07 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Configuration 114.96 ms (8)
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Factories 263.79 ms (1)
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Action "api/connect" 101.77 ms (1)
Dec 20 17:49:07 symfony [info] {sfWebResponse} Send content (242 o)
Dec 20 17:49:07 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 105 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:49:07 symfony [err] {sfRenderException} The template "connectSuccess.php" does not exist or is unreadable in "".
Dec 20 17:49:07 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:49:07 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Configuration 129.90 ms (9)
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Factories 263.79 ms (1)
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} Action "api/connect" 204.61 ms (2)
Dec 20 17:49:07 symfony [info] {sfWebDebugLogger} View "Success" for "api/connect" 103.48 ms (1)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:49:09 symfony [info] {sfPatternRouting} Match route "melody_access" (/access/:service) for /access/facebook with parameters array ( 'module' => 'sfMelody', 'action' => 'access', 'service' => 'facebook',)
Dec 20 17:49:09 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:49:09 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:49:09 symfony [info] {sfMelodyActions} Call "sfMelodyActions->executeAccess()"
Dec 20 17:49:10 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=AQCux02j9Hf37gljX1AgoEDvYmDsnHcOsRqM5r2JV02c9gdlcpOEg91t6nrIIUjC4-mApZHXyT_85AMPlrP6KW3SdyJy3WA3mtaQSMdHLhGEIYOzMx7vYQQ2ZDJIczZNcmHFQa35NvZ0bV4TBPFh-0ppw_SIksasXB37MEjasqLAbz_n2atojLBfti3zSVsBi_o" with params "client_id=202088659876193&client_secret=3639274d9ba3d2578a1a72a00da053e9&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook&code=AQCux02j9Hf37gljX1AgoEDvYmDsnHcOsRqM5r2JV02c9gdlcpOEg91t6nrIIUjC4-mApZHXyT_85AMPlrP6KW3SdyJy3WA3mtaQSMdHLhGEIYOzMx7vYQQ2ZDJIczZNcmHFQa35NvZ0bV4TBPFh-0ppw_SIksasXB37MEjasqLAbz_n2atojLBfti3zSVsBi_o" post "" by method "GET" give response ""
Dec 20 17:49:10 symfony [err] {OAuth} access token failed - facebook returns Array
(
)

Dec 20 17:49:11 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response ""
Dec 20 17:49:12 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response ""
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.name = ? AND t.identifier = ?) LIMIT 1 - (facebook, )
Dec 20 17:49:12 symfony [info] {OAuth} call url "https://graph.facebook.com/me" with params "" post "" by method "GET" give response ""
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.email_address = ?) LIMIT 1 - ()
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO sf_guard_user (algorithm, is_active, is_super_admin, created_at, updated_at) VALUES (?, ?, ?, ?, ?) - (sha1, 1, 0, 2011-12-20 17:49:12, 2011-12-20 17:49:12)
Dec 20 17:49:12 symfony [info] {myUser} User is authenticated
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.name AS s__name, s.description AS s__description, s.created_at AS s__created_at, s.updated_at AS s__updated_at, s2.user_id AS s2__user_id, s2.permission_id AS s2__permission_id, s2.created_at AS s2__created_at, s2.updated_at AS s2__updated_at FROM sf_guard_permission s LEFT JOIN sf_guard_user_permission s2 ON s.id = s2.permission_id WHERE (s2.user_id IN (?)) - (1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.name AS s__name, s.description AS s__description, s.created_at AS s__created_at, s.updated_at AS s__updated_at, s2.user_id AS s2__user_id, s2.group_id AS s2__group_id, s2.created_at AS s2__created_at, s2.updated_at AS s2__updated_at FROM sf_guard_group s LEFT JOIN sf_guard_user_group s2 ON s.id = s2.group_id WHERE (s2.user_id IN (?)) - (1)
Dec 20 17:49:12 symfony [info] {myUser} Add credential(s) ""
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : UPDATE sf_guard_user SET last_login = ? WHERE id = ? - (2011-12-20 17:49:12, 1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : DELETE FROM sf_guard_remember_key WHERE (created_at < ?) - (2011-12-05 17:49:12)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : DELETE FROM sf_guard_remember_key WHERE (user_id = ?) - (1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO sf_guard_remember_key (remember_key, user_id, ip_address, created_at, updated_at) VALUES (?, ?, ?, ?, ?) - (5rplvdbt6pkw00oskwc4ogg8ok44gww, 1, 127.0.0.1, 2011-12-20 17:49:12, 2011-12-20 17:49:12)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.user_id = ?) - (1)
Dec 20 17:49:12 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO token (name, status, o_auth_version, user_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) - (facebook, access, 2, 1, 2011-12-20 17:49:12, 2011-12-20 17:49:12)
Dec 20 17:49:12 symfony [info] {sfFrontWebController} Redirect to "http://altezis.localhost/frontend_dev.php/api/facebook"
Dec 20 17:49:12 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found"
Dec 20 17:49:12 symfony [info] {sfWebResponse} Send header "Location: http://altezis.localhost/frontend_dev.php/api/facebook"
Dec 20 17:49:12 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:49:12 symfony [info] {sfWebResponse} Send cookie "sfRemember": "5rplvdbt6pkw00oskwc4ogg8ok44gww"
Dec 20 17:49:12 symfony [info] {sfWebDebugLogger} Configuration 154.02 ms (8)
Dec 20 17:49:12 symfony [info] {sfWebDebugLogger} Factories 247.66 ms (1)
Dec 20 17:49:12 symfony [info] {sfWebDebugLogger} Action "sfMelody/access" 3182.83 ms (1)
Dec 20 17:49:12 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.24 ms (14)
Dec 20 17:49:12 symfony [info] {sfWebResponse} Send content (125 o)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 20 17:49:13 symfony [info] {sfPatternRouting} Match route "api_facebook" (/api/facebook) for /api/facebook with parameters array ( 'module' => 'api', 'action' => 'facebook',)
Dec 20 17:49:13 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 20 17:49:13 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 20 17:49:13 symfony [info] {apiActions} Call "apiActions->executeFacebook()"
Dec 20 17:49:13 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
Dec 20 17:49:13 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 20 17:49:13 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.user_id = ?) - (1)
Dec 20 17:49:14 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 20 17:49:14 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 ""
Dec 20 17:49:14 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/api/templates/facebookSuccess.php"
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 3 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 4 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 4 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\helper\UrlHelper.php on line 90 (array_merge() [function.array-merge]: Argument #2 is not an array)
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 13 (Trying to get property of non-object)
Dec 20 17:49:15 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 13 (Invalid argument supplied for foreach())
Dec 20 17:49:15 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:49:15 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 20 17:49:15 symfony [info] {main} Call "main->executeLanguage()"
Dec 20 17:49:15 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 20 17:49:15 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
Dec 20 17:49:15 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Configuration 121.08 ms (10)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Factories 140.27 ms (1)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Action "api/facebook" 1500.02 ms (1)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.05 ms (3)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} View "Success" for "api/facebook" 233.15 ms (1)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Component "main/language" 35.01 ms (1)
Dec 20 17:49:15 symfony [info] {sfWebDebugLogger} Partial "main/_language" 6.04 ms (1)
Dec 20 17:49:15 symfony [info] {sfWebResponse} Send content (48911 o)

@battika
Copy link

battika commented Dec 20, 2011

Hello Khalezis,

I had this same exact problem when I used Windows for dev environment:
Dec 20 17:49:10 symfony [err] {OAuth} access token failed - facebook returns Array

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:
mWardi/sfMelodyDemo#1

and here:
http://richardwarrender.com/2007/05/the-secret-to-curl-in-php-on-windows/

and here:
#9

I fixed the issue here:
https://github.com/battika/OAuthBase

Hope it's the same problem that you are experiencing.

@Khalezis
Copy link
Author

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:29 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 21 01:43:29 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 21 01:43:29 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 21 01:43:29 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 21 01:43:29 symfony [info] {sfPatternRouting} Match route "homepage" (/) for / with parameters array ( 'module' => 'main', 'action' => 'index',)
Dec 21 01:43:29 symfony [info] {myUser} Automatic user logout due to timeout
Dec 21 01:43:29 symfony [info] {myUser} User is not authenticated
Dec 21 01:43:29 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 21 01:43:29 symfony [info] {sfFilterChain} Executing filter "sfBasicSecurityFilter"
Dec 21 01:43:29 symfony [info] {sfBasicSecurityFilter} Action "main/index" requires authentication, forwarding to "User/signin"
Dec 21 01:43:29 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 21 01:43:29 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 21 01:43:29 symfony [info] {UserActions} Call "UserActions->executeSignin()"
Dec 21 01:43:29 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/signinSuccess.php"
Dec 21 01:43:30 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/User/templates/_signin_form.php"
Dec 21 01:43:30 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 21 01:43:30 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 21 01:43:30 symfony [info] {main} Call "main->executeLanguage()"
Dec 21 01:43:30 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 21 01:43:30 symfony [info] {sfWebResponse} Send status "HTTP/1.1 401 Unauthorized"
Dec 21 01:43:30 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Configuration 292.69 ms (13)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Factories 323.59 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Action "User/signin" 48.51 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} View "Success" for "User/signin" 433.81 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Partial "User/_signin_form" 83.03 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Component "main/language" 73.94 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebDebugLogger} Partial "main/_language" 43.07 ms (1)
Dec 21 01:43:30 symfony [info] {sfWebResponse} Send content (44480 o)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 21 01:43:37 symfony [info] {sfPatternRouting} Match route "api_connect" (/api/connect) for /api/connect with parameters array ( 'module' => 'api', 'action' => 'connect',)
Dec 21 01:43:38 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 21 01:43:38 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 21 01:43:38 symfony [info] {apiActions} Call "apiActions->executeConnect()"
Dec 21 01:43:38 symfony [info] {OAuth} "facebook" call url "https://graph.facebook.com/oauth/authorize" with params "array (
'scope' => 'email',
'client_id' => '202088659876193',
'redirect_uri' => 'http://altezis.localhost/frontend_dev.php/access/facebook',
)"
Dec 21 01:43:38 symfony [info] {sfFrontWebController} Redirect to "https://graph.facebook.com/oauth/authorize?scope=email&client_id=202088659876193&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook"
Dec 21 01:43:38 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found"
Dec 21 01:43:38 symfony [info] {sfWebResponse} Send header "Location: https://graph.facebook.com/oauth/authorize?scope=email&client_id=202088659876193&redirect_uri=http%3A%2F%2Faltezis.localhost%2Ffrontend_dev.php%2Faccess%2Ffacebook"
Dec 21 01:43:38 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Configuration 224.71 ms (8)
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Factories 236.05 ms (1)
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Action "api/connect" 62.82 ms (1)
Dec 21 01:43:38 symfony [info] {sfWebResponse} Send content (242 o)
Dec 21 01:43:38 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 105 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 21 01:43:38 symfony [err] {sfRenderException} The template "connectSuccess.php" does not exist or is unreadable in "".
Dec 21 01:43:38 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 21 01:43:38 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\exception\sfException.class.php on line 159 (Cannot modify header information - headers already sent by (output started at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\response\sfResponse.class.php:105))
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Configuration 256.25 ms (9)
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Factories 236.05 ms (1)
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} Action "api/connect" 127.32 ms (2)
Dec 21 01:43:38 symfony [info] {sfWebDebugLogger} View "Success" for "api/connect" 238.26 ms (1)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 21 01:43:40 symfony [info] {sfPatternRouting} Match route "melody_access" (/access/:service) for /access/facebook with parameters array ( 'module' => 'sfMelody', 'action' => 'access', 'service' => 'facebook',)
Dec 21 01:43:41 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 21 01:43:41 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 21 01:43:41 symfony [info] {sfMelodyActions} Call "sfMelodyActions->executeAccess()"
Dec 21 01:43:41 symfony [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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:41 symfony [err] {OAuth} access token failed - facebook returns Array
(
)

Dec 21 01:43:42 symfony [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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 [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
Dec 21 01:43:42 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.name = ? AND t.identifier = ?) LIMIT 1 - (facebook, )
Dec 21 01:43:43 symfony [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.email_address = ?) LIMIT 1 - ()
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO sf_guard_user (algorithm, is_active, is_super_admin, created_at, updated_at) VALUES (?, ?, ?, ?, ?) - (sha1, 1, 0, 2011-12-21 01:43:43, 2011-12-21 01:43:43)
Dec 21 01:43:43 symfony [info] {myUser} User is authenticated
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.name AS s__name, s.description AS s__description, s.created_at AS s__created_at, s.updated_at AS s__updated_at, s2.user_id AS s2__user_id, s2.permission_id AS s2__permission_id, s2.created_at AS s2__created_at, s2.updated_at AS s2__updated_at FROM sf_guard_permission s LEFT JOIN sf_guard_user_permission s2 ON s.id = s2.permission_id WHERE (s2.user_id IN (?)) - (1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.name AS s__name, s.description AS s__description, s.created_at AS s__created_at, s.updated_at AS s__updated_at, s2.user_id AS s2__user_id, s2.group_id AS s2__group_id, s2.created_at AS s2__created_at, s2.updated_at AS s2__updated_at FROM sf_guard_group s LEFT JOIN sf_guard_user_group s2 ON s.id = s2.group_id WHERE (s2.user_id IN (?)) - (1)
Dec 21 01:43:43 symfony [info] {myUser} Add credential(s) ""
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : UPDATE sf_guard_user SET last_login = ? WHERE id = ? - (2011-12-21 01:43:43, 1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : DELETE FROM sf_guard_remember_key WHERE (created_at < ?) - (2011-12-06 01:43:43)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : DELETE FROM sf_guard_remember_key WHERE (user_id = ?) - (1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO sf_guard_remember_key (remember_key, user_id, ip_address, created_at, updated_at) VALUES (?, ?, ?, ?, ?) - (a2t3jtdogh4ogggoo88w48ko4cww04c, 1, 127.0.0.1, 2011-12-21 01:43:43, 2011-12-21 01:43:43)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.user_id = ?) - (1)
Dec 21 01:43:43 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO token (name, status, o_auth_version, user_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) - (facebook, access, 2, 1, 2011-12-21 01:43:43, 2011-12-21 01:43:43)
Dec 21 01:43:43 symfony [info] {sfFrontWebController} Redirect to "http://altezis.localhost/frontend_dev.php/api/facebook"
Dec 21 01:43:43 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found"
Dec 21 01:43:43 symfony [info] {sfWebResponse} Send header "Location: http://altezis.localhost/frontend_dev.php/api/facebook"
Dec 21 01:43:43 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 21 01:43:43 symfony [info] {sfWebResponse} Send cookie "sfRemember": "a2t3jtdogh4ogggoo88w48ko4cww04c"
Dec 21 01:43:43 symfony [info] {sfWebDebugLogger} Configuration 214.63 ms (8)
Dec 21 01:43:43 symfony [info] {sfWebDebugLogger} Factories 409.46 ms (1)
Dec 21 01:43:43 symfony [info] {sfWebDebugLogger} Action "sfMelody/access" 2113.25 ms (1)
Dec 21 01:43:43 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.40 ms (14)
Dec 21 01:43:43 symfony [info] {sfWebResponse} Send content (125 o)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_register" (/guard/register)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key)
Dec 21 01:43:43 symfony [info] {sfPatternRouting} Match route "api_facebook" (/api/facebook) for /api/facebook with parameters array ( 'module' => 'api', 'action' => 'facebook',)
Dec 21 01:43:44 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
Dec 21 01:43:44 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
Dec 21 01:43:44 symfony [info] {apiActions} Call "apiActions->executeFacebook()"
Dec 21 01:43:44 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
Dec 21 01:43:44 symfony [info] {Doctrine_Connection_Statement} execute : SELECT s.id AS s__id, s.first_name AS s__first_name, s.last_name AS s__last_name, s.email_address AS s__email_address, s.username AS s__username, s.algorithm AS s__algorithm, s.salt AS s__salt, s.password AS s__password, s.is_active AS s__is_active, s.is_super_admin AS s__is_super_admin, s.last_login AS s__last_login, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM sf_guard_user s WHERE (s.id = ?) LIMIT 1 - (1)
Dec 21 01:43:44 symfony [info] {Doctrine_Connection_Statement} execute : SELECT t.id AS t__id, t.name AS t__name, t.token_key AS t__token_key, t.token_secret AS t__token_secret, t.user_id AS t__user_id, t.expire AS t__expire, t.params AS t__params, t.identifier AS t__identifier, t.status AS t__status, t.o_auth_version AS t__o_auth_version, t.created_at AS t__created_at, t.updated_at AS t__updated_at FROM token t WHERE (t.user_id = ?) - (1)
Dec 21 01:43:44 symfony [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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 [err] {OAuth} curl error: error setting certificate verify locations:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

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 ""
Dec 21 01:43:45 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/api/templates/facebookSuccess.php"
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 3 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 4 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 4 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\helper\UrlHelper.php on line 90 (array_merge() [function.array-merge]: Argument #2 is not an array)
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\routing\sfDoctrineRoute.class.php on line 132 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [notice] {sfWebDebugLogger} Notice at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 13 (Trying to get property of non-object)
Dec 21 01:43:45 symfony [warning] {sfWebDebugLogger} Warning at C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules\api\templates\facebookSuccess.php on line 13 (Invalid argument supplied for foreach())
Dec 21 01:43:45 symfony [info] {sfPHPView} Decorate content with "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 21 01:43:45 symfony [info] {sfPHPView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\templates/layout.php"
Dec 21 01:43:45 symfony [info] {main} Call "main->executeLanguage()"
Dec 21 01:43:45 symfony [info] {sfPartialView} Render "C:\Users\Thibaut\workspace\PHP\Altezis\apps\frontend\modules/main/templates/_language.php"
Dec 21 01:43:45 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
Dec 21 01:43:45 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Configuration 251.51 ms (10)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Factories 343.40 ms (1)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Action "api/facebook" 989.38 ms (1)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.07 ms (3)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} View "Success" for "api/facebook" 595.77 ms (1)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Component "main/language" 113.18 ms (1)
Dec 21 01:43:45 symfony [info] {sfWebDebugLogger} Partial "main/_language" 21.62 ms (1)
Dec 21 01:43:46 symfony [info] {sfWebResponse} Send content (49622 o)

@battika
Copy link

battika commented Dec 21, 2011

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:
CAfile: C:\Users\Thibaut\workspace\PHP\Altezis\plugins\sfDoctrineOAuthPlugin\lib\base/cacert.crt
CApath: none

Can you verify your cacert.crt file exists in the aforementioned path?

You can grab a copy of the certificate here:
http://curl.haxx.se/ca/cacert.pem

Just rename the file to cacert.crt after downloading it.

Hope it will solve the problem.

@Khalezis
Copy link
Author

Hi,

Thank you a lot for the solution. Indeed I didn't the file "cacert.crt". Now I have data in my database.
But I have a new probleme. Indeed, I have this error:

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
/frontend_dev.php/guard/forgot_password/

Indeed, in my array this-me I have just the key "picture"

@chok
Copy link
Owner

chok commented Dec 21, 2011

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

@Khalezis
Copy link
Author

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.

@chok
Copy link
Owner

chok commented Dec 22, 2011

You have to implement this by yourself by using redirect_register option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants