我正在尝试在我的应用程序中使用Periscope API (https://github.com/gabrielg/periscope_api/blob/master/API.md)。在API链接中,我尝试向https://api.periscope.tv/api/v2/loginTwitter?build=v1.0.2发送POST请求,请求正文如下
{
"bundle_id": "com.bountylabs.periscope",
"phone_number": "",
"session_key": "<twitter_user_oauth_key>",
"session_secret": "<twitter_user_oauth_secret>",
"user_id": "<twitter_user_id>",
"user_name": "<twitter_user_name>",
"vendor_id": "81EA8A9B-2950-40CD-9365-40535404DDE4"
}我已经在https://apps.twitter.com/中有了一个应用程序,但是我不知道该用什么作为twitter_user_oauth_key和twitter_user_oauth_secret。你能帮上忙吗?
发布于 2015-12-27 03:14:13
我必须说https://github.com/gabrielg/periscope_api/的实现有点复杂。作者使用两套密钥(IOS_*和PERISCOPE_*),实际只需要一个密钥就可以访问接口。我没有尝试广播,但在我的PHP库中,所有其他函数只需使用他所说的PERISCOPE_*键集就可以正常工作。
你将从推特上获得session_secret和session_key,并将其作为Periscope应用程序访问。
所以Periscope通过Twitter的登录过程看起来像
通过https://api.twitter.com/oauth/request_token
oauth_token、oauth_token_secret、user_id和user_name{ "bundle_id":"com.bountylabs.periscope","phone_number":"","session_key":"oauth_token","session_secret":"oauth_token_secret","user_id":"user_id","user_name":"user_name","vendor_id":"81EA8A9B-2950-40CD-9365-40535404DDE4“}
cookie值,并将其作为某种身份验证令牌添加到所有JSON API调用中。第1步和第4步中的请求应该使用适当的Authorization头进行签名,这需要Periscope应用程序的consumer_key和consumer_secret。虽然在第一步就可以嗅探到consumer_key (如果您能够绕过证书锁定),但是consumer_secret永远不会离开您的设备,您无法通过简单的流量拦截来获取它。
下面是登录进程https://gist.github.com/bearburger/b4d1a058c4f85b75fa83的示例
发布于 2015-11-27 02:44:26
Periscope的API不是公开的,您引用的库是一种黑客行为。
为了回答最初的问题,oauth_key和oauth_secret是由您的实际设备发送到潜望镜服务的密钥。您可以通过嗅探设备发送的网络流量来查找它们。
https://stackoverflow.com/questions/31854771
复制相似问题