gpt4 book ai didi

php - LinkedIn 回调不适用于某些 URL(使用 Zend Framework)

转载 作者:搜寻专家 更新时间:2023-10-31 21:40:04 26 4
gpt4 key购买 nike

LinkedIn 似乎不喜欢重定向回我的测试站点的想法。

此代码毫无问题地将我定向到 LinkedIn 确认页面:(这几乎是使用 Zend 的 OAuth 的样板示例)

$options = array(    'version'               => '1.0',    'callbackUrl'           => 'http://dev.local/',    'requestTokenUrl'       => 'https://api.linkedin.com/uas/oauth/requestToken',    'userAuthorizationUrl'  => 'https://api.linkedin.com/uas/oauth/authorize',    'accessTokenUrl'        => 'https://api.linkedin.com/uas/oauth/accessToken',    'consumerKey'           => [api],    'consumerSecret'        => [secret]);$consumer = new Zend_Oauth_Consumer( $options );// Start Requesting a LinkedIn Request Token$token = $consumer->getRequestToken ();// Store the LinkedIn Request Token$_SESSION ['REQUEST_TOKEN'] = serialize ( $token );// Redirect the Web User to LinkedIn Authentication  Page$consumer->redirect ();

但是,如果我的回调是 http://dev.local/,它不会重定向,但如果我指定一个有效域(如 http://www.google.com) 它重定向没有问题。

此行为最近发生(大约一个月前它工作正常)。这显然是一个严重的痛苦,因为我需要部署代码才能测试任何东西。

这是人们遇到过的问题吗?有人找到解决方法吗?

最佳答案

这似乎是因为 LinkedIn changed their API ,特别是 api 如何与 Oauth 交互:

On the technical side, we've borrowed the OAuth 2.0 concept of the"scope" parameter and incorporated it into our OAuth 1.0a and JSAuthentication flows.

似乎其他应用程序、插件和库也遇到了一些困难。

关于php - LinkedIn 回调不适用于某些 URL(使用 Zend Framework),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12204591/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com