在使用带有LinkedIn API的Signinwith时,如何解决“您需要从LinkedIn请求权限”?

问题描述 投票:0回答:1

我们按照下面的所有说明操作,但现在出现错误:“没有足够的权限访问”。搜索堆栈溢出(保留支持文章)告诉我们以下内容:Any queries to the api.linkedin.com/v2/ return "Not enough permissions to access ..."

任何人都可以协助以上。我们尝试过LinkedIn支持,说实话,它们毫无用处。我们花了5天的时间才得到一个名为'Anu'的人的基本回复。

我们遵循的说明

https://www.linkedin.com/developers/apps/ - 登录到您的LinkedIn帐户时需要添加应用程序https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context新成员需要遵循使用OAuth 2.0进行身份验证

https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication?context=linkedin/consumer/context LinkedIn API使用OAuth 2.0进行用户授权和API身份验证。必须先对应用程序进行授权和身份验证,然后才能从LinkedIn获取数据或访问成员数据。按照权限中的两个授权流程之一开始。 https://docs.microsoft.com/en-us/linkedin/shared/authentication/permissions?context=linkedin/context会员授权或授权代码流程(3条腿授权):LinkedIn会员授予您的应用程序访问LinkedIn会员资源的权限。如果您要求访问会员帐户以使用其数据并代表他们提出请求,请使用此流程。 https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context

我们运行工作委员会,我们想要的是让我们的候选人能够与LinkedIn签约。

linkedin linkedin-api
1个回答
0
投票

请检查应用是否具有这些默认权限

r_liteprofile,r_emailaddress,w_member_social。

以下端点将帮助您进行授权。

$params = array('response_type' => 'code',
            'client_id' => $this->api_key,
            'scope' => $this->scope ,// these are the three permissions
            'state' => uniqid('', true), // unique long string
            'redirect_uri' => 'redirect url',
        );
        // Authentication request
        $url = 'https://www.linkedin.com/oauth/v2/authorization?' . http_build_query($params);
        header("Location: $url");

您可以从上面的EP请求返回状态代码的accessstoken。

© www.soinside.com 2019 - 2024. All rights reserved.