Twitter OAuth
新浪微博和 Twitter 的 Oauth API 为什么感觉流程不一样
新浪:
- 开发者引导用户到新浪授权页面, 页面链接中需要带上自己的 apikey :
- 用户授权后新浪跳转到开发者指定指定的页面,并且附上服务器返回的一枚 code 作为 param ;
- 开发者用这枚 code ,再加上自己的 apikey 和 api secret 去 post https://api.weibo.com/oauth2/access_token ;
- post 返回 access_token;
- 以后开发者每次用这枚 access_token 请求用户资源。
Twitter:
- 开发者首先把自己的 apikey 等信息加密作为 Header 里面的 Authorization 去 post https://api.twitter.com/oauth/request_token?call_back=balabala , 获得 auth_token ;
- 开发者再把用户引导到 Twitter 授权页面,并且需要传入这枚 auth_token 作为参数;
- 用户授权后开发者再获得 oauth_token 和 oauth_verifier , 开发者再把这一步获得的 auth_token 和 第一步的进行校验;
- 开发者再拿上一步获得的 oauth_verifier 和 oauth_token 去 post https://api.twitter.com/oauth/access_token , 成功后获得 oauth_token, uid, username 这些,然后再自己解析获得 access_token 。
- 以后开发者每次用这枚 access_token 请求用户资源。
感觉 Twitter 的要麻烦, 主要就是在引导用户授权之前还要自己先去 post 服务器临时获得一枚 auth_token 。
Question: How long does an access token last?
Answer: We do not currently expire access tokens. Your access token will be invalid if a user explicitly rejects your application from their settings or if a Twitter admin suspends your application. If your application is suspended there will be a note on your application page saying that it has been suspended.
Single-user OAuth with Examples
Securing keys and access tokens
Twitter OAuth的更多相关文章
- Twitter开发
开发文档:https://developer.twitter.com/ the Twitter Developer Account Application 示例:https://wptweetboos ...
- 【AMAD】django-social-auth -- 让django使用社交网络oauth鉴权变得极为轻松!
简介 个人评分 简介 django-social-auth1集成的Oauth API包括: Google OpenID Google Oauth Google Oauth2 Yahoo OpenID ...
- Python(九)Tornado web 框架
一.简介 Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本.这个 Web 框架看起来有些像web.py 或者 Google 的 webapp,不过 ...
- PHP资源列表
一个PHP资源列表,内容包括:库.框架.模板.安全.代码分析.日志.第三方库.配置工具.Web 工具.书籍.电子书.经典博文等等. 初始翻译信息来自:<推荐!国外程序员整理的 PHP 资源大全& ...
- tornado web 框架的认识
tornado 简介 1,概述 Tornado就是我们在 FriendFeed 的 Web 服务器及其常用工具的开源版本.Tornado 和现在的主流 Web 服务器框架(包括大多数 Python 的 ...
- 【PHP资源】PHP 资源大全
看到这篇文章不错,转来收藏 依赖管理 依赖和包管理库 Composer/Packagist:一个包和依赖管理器 Composer Installers:一个多框架Composer库安装器 Pickle ...
- Github上的PHP资源汇总大全
依赖管理 ——用于依赖管理的包和框架 Composer/Packagist : 一个包和依赖管理器 Composer Installers: 一个多框架Composer库安装器 Pickle: 可以 ...
- 【PHP开发】国外程序员收集整理的 PHP 资源大全
依赖管理 依赖和包管理库 Composer/Packagist:一个包和依赖管理器 Composer Installers:一个多框架Composer库安装器 Pickle:一个PHP扩展安装器 其他 ...
- 优秀的PHP开源项目集合
包管理Package Management Package Management Related 框架 框架组件 微框架Micro Frameworks 内容管理系统Content Managemen ...
随机推荐
- LDA的Gibbs Sampling求解
<LDA数学八卦>对于LDA的Gibbs Sampling求解讲得很详细,在此不在重复在轮子,直接贴上该文这部分内容. Gibbs Sampling 批注: 1. ...
- ResourceBundle与Properties读取配置文件
ResourceBundle与Properties的区别在于ResourceBundle通常是用于国际化的属性配置文件读取,Properties则是一般的属性配置文件读取. ResourceBundl ...
- Vue + vant-UI 打造移动商城
- nextjs 服务端渲染请求参数
Post.getInitialProps = async function (context) { const { id } = context.query const res = await fet ...
- 深度学习之循环神经网络RNN概述,双向LSTM实现字符识别
深度学习之循环神经网络RNN概述,双向LSTM实现字符识别 2. RNN概述 Recurrent Neural Network - 循环神经网络,最早出现在20世纪80年代,主要是用于时序数据的预测和 ...
- eclipse中的tomca的编辑页面server location灰色
clipse中tomcat service设置 选择window ----show view---services可以看到服务的面板 双击tomcat进入配置界面Service Locations(S ...
- jmeter压力测试及抓包
如何使用jmeter进行分布式压力测试? 1.其他的压力机启动jmeter-server 2.在主控机jmeter的配置文件jmeter.properties里面找到,remote_hosts=xx, ...
- The Little Prince-12/02
The Little Prince-12/02 What moves me so deeply, about this little prince who is sleeping here, is h ...
- Qt发布可执行程序
在Qt Creator下用release跑一遍程序,生成相应的EXE文件. 在Qt Creator下编译好的release下的 youProgramName.exe 拷贝到一个文件夹下面: 在 ...
- django 模型类的常见字段约束,以及filter 过滤和查询
null 不设置时默认设置为False.设置为True时,数据库表字段中将存入NULL的记录. null和blank组合使用,null=True,blank=True,表示该字段可以为空 blank ...