You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have configured this package with laravel 4.2.17. When i am trying to create login with facebook i am getting an error "Call to a member function getAuthorizationUri() on null". I have created new App in Facebook with version 2.8 and set redirect url in config file same as configured in Facebook App.
Below is my code in Controller.php:
public function loginWithFacebook() {
// get data from input
$code = Input::get( 'code' );
// get fb service
$return_url = URL::to('/') ."/login/fb/";
$fb = OAuth::consumer( 'Facebook',$return_url );
// check if code is valid
// if code is provided get user data and sign in
if ( !empty( $code ) ) {
// This was a callback request from facebook, get the token
$token = $fb->requestAccessToken( $code );
// Send a request with it
$result = json_decode( $fb->request( '/me' ), true );
$message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];
echo $message. "<br/>";
//Var_dump
//display whole array().
dd($result);
}
// if not ask for permission first
else {
// get fb authorization
$url = $fb->getAuthorizationUri();
// return to facebook login url
return Redirect::to( (string)$url );
}
I have updated Facebook App client_id and client_secret in my app/config/oauth-4-laravel.php:
Also getting a same issue for Login with Linkedin, Google. Thanks in advance for help.
The text was updated successfully, but these errors were encountered:
sw-tt-aniruddhbhavsar
changed the title
Facebook Login Issue with Facebook Graph API Version 2.8
Call to a member function getAuthorizationUri() on null: Facebook Login Issue with Facebook Graph API Version 2.8
Apr 5, 2017
Hi,
I have configured this package with laravel 4.2.17. When i am trying to create login with facebook i am getting an error "Call to a member function getAuthorizationUri() on null". I have created new App in Facebook with version 2.8 and set redirect url in config file same as configured in Facebook App.
Below is my code in Controller.php:
}
Below is my code in app/config/app.php:
I have updated Facebook App client_id and client_secret in my app/config/oauth-4-laravel.php:
Also getting a same issue for Login with Linkedin, Google. Thanks in advance for help.
The text was updated successfully, but these errors were encountered: