console
和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
用户信息
注意这里是 这个api 是 user context only
的,也就是只支持 oauth1
关于安全
这个似乎可以玩一下:
https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project
https://www.owasp.org/index.php/Main_Page