twitter api

console

https://developer.twitter.com

和google FB不一样,即使是简单的登录的开发者权限也依然是需要批准的
这篇是2019年6月写的,使用中国手机申请会被拒绝,不过可以用google voice注册
google voice 同样不支持中国手机号绑定

oauth

twitter 没有提供封装好的前端sdk,只有
https://developer.twitter.com/en/docs/developer-utilities/twitter-libraries.html

oauth 文档:
https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter
Authorization 头生成:
https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request
Authorization 头 中的signature 生成:
https://developer.twitter.com/en/docs/basics/authentication/guides/creating-a-signature.html

twitter 的oauth是最麻烦的,可能因为是oauth1.0
所有oauth 有关的api,可以看到其中oauth2 只有两个api
https://developer.twitter.com/en/docs/basics/authentication/api-reference/invalidate_bearer_token
从下面对oauth的说明中,我们可以知道,
一些只读且和用户无关的操作可以用个oauth2 的token( bearer token) 调用,
另外一些比如发推这种操作就需要Application-user authentication( OAuth 1a access token for user context)
https://developer.twitter.com/en/docs/basics/authentication/overview/oauth

oauth2 的文档和例子:
https://developer.twitter.com/en/docs/basics/authentication/api-reference/token
https://developer.twitter.com/en/docs/basics/authentication/guides/bearer-tokens.html

Access token & access token secret 生成和作用(应该就是只能访问自己的资源的相当于从oath1a的最后一步开始)
https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens.html
https://developer.twitter.com/en/docs/basics/authentication/guides/single-user

用户信息

文档:
https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials

注意这里是 这个api 是 user context only 的,也就是只支持 oauth1

关于安全

这个似乎可以玩一下:
https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project
https://www.owasp.org/index.php/Main_Page

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值