zoukankan      html  css  js  c++  java
  • Asp.net core Authentication and Authorization

    之前有写过关于这些的文章, 本来想认证写一个系类的,但是感觉非常大. 太多工了.

    先记入一些零零散散的. 看看以后要不要整理起来。

    refer resources : 

    https://www.cnblogs.com/stulzq 晓晨博客 

    https://www.cnblogs.com/sheng-jie/p/9430920.html 圣杰博客 identity server 4 知多少

    https://www.cnblogs.com/sheng-jie/p/6564520.html 圣杰博客 oauth 2.0 知多少

    Access token type, self-contained (self-encoded type) vs reference (identifier type)

    access token 有 2 种, 一种是作为一个 reference key, 每当 resource server 拿到 access token 后并不能知道授权的具体信息. 

    而是需要用 token 去访问 autho server 获取授权信息. 这个做法的缺点就是每次都要去访问 autho server 性能可能有点伤, 好处就是可以立刻 revoke token

    另一种叫 self-contained 当 resource server 拿到 access token 后它自己就可以解锁. 这里用的是不对称加密. 私钥加密,公钥解锁. 

    好处就是不用每次去 autho server 咯, 性能快一点, 坏处就是你无法立刻去 revoke token. 而是需要等它自己过期. 所以 access token 就要设置时间段, 而 refresh token 就需要一直去续命. 

    oauth 没有规定用哪一种, 建议大家自己去做 balance 权衡.

    相关的资源 : 

    https://www.oauth.com/oauth2-servers/listing-authorizations/revoking-access/

    https://www.oauth.com/oauth2-servers/access-tokens/self-encoded-access-tokens/

    https://darutk.medium.com/oauth-access-token-implementation-30c2e8b90ff0

    https://docs.wso2.com/m/mobile.action#page/76748735

    https://docs.wso2.com/display/IS540/Self-contained+Access+Tokens

  • 相关阅读:
    TI DM3730 EBOOT分析(一)
    收费系统三层+抽象工厂+反射实例
    sql语句中的时间查询
    五线谱学习软件
    hdu1061Rightmost Digit(附20循环的规律解法和附快速幂简单原理)
    云计算安全指南
    linux 下orcale基本操作指令
    HDU/HDOJ 2102 A计划 广度优先搜索BFS
    网站优化策略之SEO必知的七大技巧
    SEO之四大要不得
  • 原文地址:https://www.cnblogs.com/keatkeat/p/14398753.html
Copyright © 2011-2022 走看看