OAuth2.0琐记

  1. 四种角色
    • 客户端(第三方Application,Client)
    • 资源所有者(用户,Resource Owner,RO)
    • 授权服务器(Authorization Server,AS)
    • 资源服务器(Resource Server,RS)
      另外还Agent(一般指浏览器)
  2. 四种grant type
    • Authorization Code: used with server-side Applications,用于Client从服务器端与RS交换数据
    • Implicit: used with Mobile Apps or Web Applications (applications that run on the user’s device),在浏览器或App中与RS交换数据
    • Resource Owner Password Credentials: used with trusted Applications, such as those owned by the service itself(RO信任Client把账户密码给Client用于其与RS交换数据)
    • Client Credentials: used with Applications API access,Client访问自己在RS上的资源,Client即为RO
  3. 第1种grant type为何要使用authorization code

    • 安全考虑,authorization code这种grant type,最适合服务器端web应用。code用于Client向RS交换token,token甚至对于RO及Agent都不必知道。即在浏览器中不必出现token,token只在Client的服务器端与RS间使用。
    • 这种类型可用于长生命期(Long-lived),Client对RS的访问,不必须每次申请token,但可以有refresh token。

    参考:
    参考1,需要翻墙
    参考2
    参考3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值