我正在尝试在我的应用程序中使用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。你能帮忙吗?
答案 0 :(得分:3)
我必须说https://github.com/gabrielg/periscope_api/实现有点复杂。当您实际只需要一个密钥来访问API时,作者使用2组密钥(IOS_ *和PERISCOPE_ *)。我没有尝试广播,但在我的PHP库中,所有其他功能都可以毫无困难地工作,只有他称之为PERISCOPE_ *键组。
在以Periscope应用程序访问它之后,您将从Twitter获得session_secret
和session_key
。
所以Periscope通过Twitter流程登录就像
oauth_token
和oauth_verifier
oauth_token
,oauth_token_secret
,user_id
和user_name
向https://api.periscope.tv/api/v2/loginTwitter发送请求
{
"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
的PHP示例答案 1 :(得分:0)
Periscope的API不公开,你所指的库是一种黑客攻击。
要回答原始问题,oauth_key
&amp; oauth_secret
是您的实际设备发送给潜望镜服务的密钥。您可以通过嗅探设备发送的网络流量来找到它们。