ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

02选看OAuth2.0简介(下)-2020-10-26 09~10

2022-04-28 09:35:41  阅读:151  来源: 互联网

标签:02 10 26 端点 Token https com png 客户端



原文:https://www.yuque.com/yuejiangliu/dotnet/asu0b9


           02 选看 OAuth 2.0 简介(下).mp4     (25 MB)             <a class="lake-embed-toolbar-btn " data-aspm-click="preview" data-aspm-param="unknown">                   </a>        <a class="lake-embed-toolbar-btn " data-aspm-click="download" data-aspm-param="unknown">                   </a>   

一、端点 Endpoint

  • Authorization Endpoint,授权端点

  • 在浏览器里面和用户交互

  • 资源所有者通过该端点对客户端应用进行授权操作

  • Token Endpoint,Token 端点

  • 客户端应用向该端点展示它的授权(或 Refresh Token)以获得 Access Token

                                           <i class="anticon anticon-exclamation-circle">               <svg viewbox="64 64 896 896" class="" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">                 <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zM488 576h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path>               </svg>             </i>                      ![image](https://cdn.nlark.com/yuque/0/2019/png/101969/1556539887823-33598bd7-8ac4-4a81-901e-656601c8810a.png?x-oss-process=image%2Fresize%2Cw_1028)                                                               
    

二、范围 Scope

代表资源所有者在被保护资源那里的一些权限。

三、Access Token

  • 有时候就叫做 Token

  • 用来访问被保护资源的凭据

  • 代表了给客户端颁发的授权,也就是委托给客户端的权限

  • 必须描述出 Scope 和有效期

四、Refresh Token

  • 用来获取 Access Token 的凭据

  • 由 Authorization Server 颁发给客户端应用的

  • 可选

  • 具备让客户端应用逐渐降低访问权限的能力

  • Refresh 回来的 Acess Token 可能 Scope 越来越小

                                           <i class="anticon anticon-exclamation-circle">               <svg viewbox="64 64 896 896" class="" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">                 <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zM488 576h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path>               </svg>             </i>                      ![image](https://cdn.nlark.com/yuque/0/2019/png/101969/1556543704958-b315b429-0f8a-49ae-8064-c72adb01f8f2.png)                                                               
    
                                           <i class="anticon anticon-exclamation-circle">               <svg viewbox="64 64 896 896" class="" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">                 <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zM488 576h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path>               </svg>             </i>                      ![image](https://cdn.nlark.com/yuque/0/2019/png/101969/1556543780080-3cc2abe4-7149-43e7-90b2-b3616e37d2b6.png)                                                               
    

五、端点发生错误时

发送错误时返回:

  • error:错误类型

  • error_description

  • error_uri:指向错误详情页

  • state

  • Authorization Endpoint

  • 错误信息通过 query string 返回

  • https://xxxx.xxx.xx//authorize?error=invalid request

  • Token Endpoint

  • 错误信息通过 Post body 返回

  •                                          <i class="anticon anticon-exclamation-circle">               <svg viewbox="64 64 896 896" class="" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">                 <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zM488 576h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"></path>               </svg>             </i>                      ![image](https://cdn.nlark.com/yuque/0/2019/png/101969/1556544059999-6c390ef3-7adf-48bc-a901-fa54988663d4.png)                                                                                                
    

六种错误类型:

  • invalid_request

  • invalid_client(401)

  • invalid_grant

  • unauthorized_client

  • unsupported_grant_type

  • invalid_scope

标签:02,10,26,端点,Token,https,com,png,客户端
来源: https://www.cnblogs.com/springsnow/p/16201549.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有