官方文档:

https://shiro.apache.org/reference.html

https://shiro.apache.org/java-authentication-guide.html

Terminology you’ll need

  • Subject - Security specific user ‘view’ of an application user. It can be a human being, a third-party process, a server connecting to you application, or even a cron job. Basically, it is anything or anyone communicating with your application.

  • Principals - A subjects identifying attributes. First name, last name, social security number, username

  • Credentials - secret data that are used to verify identities. Passwords, Biometric data, x509 certificates,

  • Realms - Security specific DAO, data access object, software component that talks to a backend data source. If you have usernames and password in LDAP, then you would have an LDAP Realm that would communicate with LDAP. The idea is that you would use a realm per back-end data source and Shiro would know how to coordinate with these realms together to do what you have to do.

First, we need to acquire the currently executing user, referred to as the subject.

  A subject is just a security specific view of the user—-it can be a human, a process, cron job, doesn’t matter.

About "READMEMBER ME"

In Shiro, the Subject object supports two methods : isRemembered() and isAuthenticated().

A “remembered” subject has an identity (it is not anonymous) and their identifying attributes,referred to as principals, are remembered from a successful authentication during a previous session.

An authenticated subject has proved their identity during their current session.

  If a subject is remembered, it DOES NOT mean they are authenticated.  

Login/Logout

 //With most of Shiro, you'll always want to make sure you're working with the currently
//executing user, referred to as the subject
Subject currentUser = SecurityUtils.getSubject(); //Authenticate the subject by passing
//the user name and password token
//into the login method
currentUser.login(token); //Your Code Here
currentUser.logout(); //removes all identifying information and invalidates their session too.

rich exception hierarchy

丰富的异常层级(机制)

 try {
currentUser.login(token);
} catch ( UnknownAccountException uae ) { ...
} catch ( IncorrectCredentialsException ice ) { ...
} catch ( LockedAccountException lae ) { ...
} catch ( ExcessiveAttemptsException eae ) { ...
} ... your own ...
} catch ( AuthenticationException ae ) {
//unexpected error?
}
//No problems, show authenticated view…

词汇部分

译:

Again really, really easy   非常非常简单/容易

retain         保留

authentication attempt     验证尝试.n

hierarchy        等级制度、层次、层级、阶层、层次结构

integration         整合;集成

音:

[E] Shiro 官方文档阅读笔记 The Reading Notes of Shiro's Offical Docs的更多相关文章

  1. python2.7官方文档阅读笔记

    官方地址:https://docs.python.org/2.7/tutorial/index.html 本笔记只记录本人不熟悉的知识点 The Python Tutorial Index 1 Whe ...

  2. 保存与恢复变量和模型,tensorflow官方文档阅读笔记

    官方中文文档的网址先贴出来:https://tensorflow.google.cn/programmers_guide/saved_model tf.train.Saver 类别提供了保存和恢复模型 ...

  3. Effective Go(官方文档)笔记

    Effective Go(官方文档)笔记 自己主动局部变量提升(编译期完毕?):return &...; 内置函数: new/make copy, append delete range(这是 ...

  4. pm2 官方文档 学习笔记

    一.安装 1.安装 npm install pm2 -g 2.更新 npm install pm2 -g && pm2 update pm2 update 是为了刷新 PM2 的守护进 ...

  5. vue.js 2.0 官方文档学习笔记 —— 01. vue 介绍

    这是我的vue.js 2.0的学习笔记,采取了将官方文档中的代码集中到一个文件的形式.目的是保存下来,方便自己查阅. !官方文档:https://cn.vuejs.org/v2/guide/ 01. ...

  6. Vue2.0 官方文档学习笔记

    VUE2.0官方文档 基础部分: 1.VUE简介 Vue是一个基于MVVM的框架,其中M代表数据处理层,V代表视图层即我们在Vue组件中的html部分,VM即M和V的结合层,处理M层相应的逻辑数据,在 ...

  7. django官方文档读书笔记

    写在前面:这算是第二次读英文原文文档,第一次是读scrapy,感觉还是要做笔记,好记性不如烂笔头,现在已经忘了scrapy文档讲了什么了,心疼.以后要多读多写 经过半年的基础学习(懒,拖延)终于来到w ...

  8. Less 官方文档学习笔记

    LESS 是css的一种扩展,它的编辑器是基于node.js 的less.js,将less文件编译成css文件(可压缩). 其中的概念: 变量:定义变量来代替某个值,只能编译一次,本质是“常量”.例如 ...

  9. Spark监控官方文档学习笔记

    任务的监控和使用 有几种方式监控spark应用:Web UI,指标和外部方法 Web接口 每个SparkContext都会启动一个web UI,默认是4040端口,用来展示一些信息: 一系列调度的st ...

随机推荐

  1. 【前端开发环境】前端使用GIT管理代码仓库需要掌握的几个必备技巧和知识点总结

    1. Git的三种状态 已提交 committed 已暂存 staged 已修改 modified 2. Git的三个区域 Git仓库 是 Git 用来保存项目的元数据和对象数据库的地方. 这是 Gi ...

  2. python中easydict的简单使用

    easydict的作用:EasyDict可以使得以属性的方式去访问字典的值! 1. 实例1:获取字典的值 2. 实例2: 设置属性 3. 在深度学习中往往利用easydict建立一个全局的变量

  3. Kafka界面管理工具-kafkamanager

    在上一篇文章<Linux安装Kafka>中,已经介绍了如何在Linux安装Kafka,以及Kafka的启动/关闭和创建发话题并产生消息和消费消息.这篇文章就介绍介绍Kafka管理界面(ka ...

  4. idea中的后缀补全

    IDEA有个很牛逼的功能,那就是后缀补全(Postfix Completion),这个功能可以通过后缀来使用代码补全进行模板式地补全语句,如遍历循环语句(for.foreach).使用 String. ...

  5. 使用 Logstash 和 JDBC 确保 Elasticsearch 与关系型数据库保持同步

    为了充分利用 Elasticsearch 提供的强大搜索功能,很多公司都会在既有关系型数据库的基础上再部署Elasticsearch.在这种情况下,很可能需要确保 Elasticsearch 与所关联 ...

  6. C#刷遍Leetcode系列连载 索引

    C#刷遍Leetcode系列文章 索引 索引(陆续发布中,请保持关注) C#刷遍Leetcode面试题系列连载(1) - 入门与工具简介 C#刷遍Leetcode面试题系列连载(2): No.38 - ...

  7. convert datatable to List<T>

    public class DataConvert { public static List<T> ConvertDataTable<T>(DataTable dt) { Lis ...

  8. web api 记录部署IIS获取服务器地址的类型

    获取服务器地址类型分多种,以下记录 1.HttpContext.Current.Server.MapPath("~/File") 返回的值为 D:\3Project\Code\Mo ...

  9. python 排序 拓扑排序

    在计算机科学领域中,有向图的拓扑排序是其顶点的先行排序,对于每个从顶点u到顶点v的有向边uv,在排序的结果中u都在v之前. 如果图是有向无环图,则拓扑排序是可能的(为什么不说一定呢?) 任何DAG具有 ...

  10. 安装Yapi时,出现json-schema-faker模块找不到问题

    今天换了一台机器按以前的方式安装Yapi工具时,竟然出现了错误. 一 安装yapi时,出现了下面的报错,一开始以为没安装json-schema-faker模块.后面通过找资料,发现是权限问题, 使用c ...