1
votes

What are possible reasons for this problem? I followed this totorial using HybridAuth and Laravel 4 to authenticate via LinkedIn.

I am getting this message: Authentication failed! LinkedIn returned an invalid Token.

Any Idea, maybe becauase of the localhost configuration?

enter image description here

**//Configuration Part**
<?php

return
array(
    "base_url" => URL::to('http://localhost:8000/social/auth'),

    "providers" => array (
        "LinkedIn" => array (
            "enabled" => true,
            "keys"    => array ( "key" => "xxx", "secret" => "xxx"),
            "scope" => 'r_basicprofile, r_emailaddress'
        )
    ),

    // if you want to enable logging, set 'debug_mode' to true  then provide a writable file by the web server on "debug_file"
    "debug_mode" => false,

    "debug_file" => "",
); 
?>

At the LinkedIn Api I am getting following Keys:

Consumer Key / API Key: 75tgxxxasdfeulcip

Consumer Secret / Secret Key: JtOXIXasdfasdfgpyFvi7

OAuth 1.0a User Token: 7b5955fe-6afc-4120-b148-55casdfasdf

OAuth 1.0a User Secret: c7824d63-46c2-4549-bce1-8f5casdfasdf

In the HybridConfig I am using Consumer Key & Secret?! Do I have to use Oauth1.0a in the config Array?

Update: I was ending up using Oauth2-Client.

best M

2
yes to your question; also make sure you generate new ones after posting them here... - Hans Z.
I changed them to asdf, best M - mboeckle

2 Answers

0
votes

HybridAuth is using OAuth 1.0 so make sure you're using the OAuth 1.0a User Token and Secret generated for your app.

0
votes

Reason is that "rw_nus" is depricated i Go to the following file LinkedIn.php and change the "_URL_REQUEST"

const _URL_REQUEST='https://api.linkedin.com/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress+rw_nus'; 

to

const _URL_REQUEST='https://api.linkedin.com/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress';