artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
685 stars 217 forks source link

artdarek/oauth-4-laravel configuration problem #161

Open shamshi1988 opened 8 years ago

shamshi1988 commented 8 years ago

hello i am new to laravel i have just install this package for the use of the authentication but i am unable to understand that the code used in the controller

// get data from input $code = Input::get( 'code' );

so what vale i have to passed from the login page as it retrieved in the controler from the input "code"

please help me becouse of this simple issue i cant use the plugin in my app as it seems to very good plugin for the all social site for authentication

artdarek commented 8 years ago

You don't have to pass value for "code" this is smth that facebook (or other oAuth service) should return to you... its simple if "code" is not passed there is "else" statement that should be fired:

 // if not ask for permission first
    else {
        // get fb authorization
        $url = $fb->getAuthorizationUri();

        // return to facebook login url
         return Redirect::to( (string)$url );
    }

this will ask user to grand permissions and next facebook should redirect user back to the same action in your controller but with proper value for "code" variable this time...

shamshi1988 commented 8 years ago

thnaks for yor reply artdarek now iam able to access the login authentication using facebook but it do not require for confirmation it just display the user details and also in case of linkedin and gplus there is an error of invalid redirect_uri as i matched the same uri that one i am calling but still its giving error. please help me if there is any another option or what i need to do for that.