简体   繁体   English

HybridAuth:身份验证失败! LinkedIn返回了无效的令牌

[英]HybridAuth: Authentication failed! LinkedIn returned an invalid Token

What are possible reasons for this problem? 此问题的可能原因是什么? I followed this totorial using HybridAuth and Laravel 4 to authenticate via LinkedIn. 我遵循教程,使用HybridAuth和Laravel 4通过LinkedIn进行身份验证。

I am getting this message: Authentication failed! 我收到此消息: 身份验证失败! LinkedIn returned an invalid Token. LinkedIn返回了无效的令牌。

Any Idea, maybe becauase of the localhost configuration? 任何想法,也许是因为localhost配置?

在此处输入图片说明

**//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: 在LinkedIn Api,我得到以下关键信息:

Consumer Key / API Key: 75tgxxxasdfeulcip 使用者密钥/ API密钥: 75tgxxxasdfeulcip

Consumer Secret / Secret Key: JtOXIXasdfasdfgpyFvi7 消费者秘密/秘密密钥: JtOXIXasdfasdfgpyFvi7

OAuth 1.0a User Token: 7b5955fe-6afc-4120-b148-55casdfasdf OAuth 1.0a用户令牌: 7b5955fe-6afc-4120-b148-55casdfasdf

OAuth 1.0a User Secret: c7824d63-46c2-4549-bce1-8f5casdfasdf OAuth 1.0a用户密码: c7824d63-46c2-4549-bce1-8f5casdfasdf

In the HybridConfig I am using Consumer Key & Secret?! 在HybridConfig中,我正在使用Consumer Key&Secret ?! Do I have to use Oauth1.0a in the config Array? 我必须在配置数组中使用Oauth1.0a吗?

Update: I was ending up using Oauth2-Client . 更新:我最终使用Oauth2-Client

best M 最好的M

HybridAuth使用的是OAuth 1.0,因此请确保您使用的是为您的应用生成的OAuth 1.0a用户令牌和密码。

Reason is that "rw_nus" is depricated i Go to the following file LinkedIn.php and change the "_URL_REQUEST" 原因是“ rw_nus”被贬低,我转到以下文件LinkedIn.php并更改“ _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'; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM