zoukankan      html  css  js  c++  java
  • 认证 (authentication) 和授权 (authorization) 的区别

    authorization 授权

    authentication 身份认证

    用户认证流程:

    1.用户使用username和password登录

    2.系统验证这个password对于该username是正确的

    3.假设第二步验证成功,获取该用户的上下文信息(如他的角色列表)

    4.围绕该用户建立安全上下文(security context)

    5.用户可能继续进行的一些操作被一个验证控制机制潜在的管理,这个验证机制会根据当前用户的安全上下文来验证权限。

    认证过程是前三步。

    在Spring Security中是这样处理这三部分的:

    1.username和password被获得后封装到一个UsernamePasswordAuthenticationToken(Authentication接口的实例)的实例中

    2.这个token被传递给AuthenticationManager进行验证

    3.成功认证后AuthenticationManager将返回一个得到完整填充的Authentication实例

    4.通过调用SecurityContextHolder.getContext().setAuthentication(...),参数传递authentication对象,来建立安全上下文(security context)


    仅供学习参考,侵权删

    原文地址:https://www.cnblogs.com/shiyu404/p/6530894.html

  • 相关阅读:
    【python接口自动化】httpUtils
    mac上安装chromedriver
    python自动化测试报告(excel篇)
    Fiddler 手机抓包介绍
    Fiddler 简单介绍
    Python splinter 环境搭建
    Python pip 常用命令
    Python Yaml 学习
    Jmeter
    Python3 操作Excel
  • 原文地址:https://www.cnblogs.com/zhangym118/p/9797026.html
Copyright © 2011-2022 走看看