前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Springsecurity之Authentication

Springsecurity之Authentication

作者头像
克虏伯
发布2019-04-15 10:50:02
5160
发布2019-04-15 10:50:02
举报

   Authentication是个接口,如下图1所示,此图来自于《Pro Spring Security》,建议读者阅读原书:

                                                                      图1 Authentication的继承图

    原书,讲的很好,原文是:

    "An Authentication object is used both when an authentication request is created (when a user logs in), to carry around the different layers and classes of the framework the requesting data, and then when it is validated, containing the authenticated entity and storing it in SecurityContext.

    The most common behavior is that when you log in to the application a new Authentication object will be created storing your user name, password, and permissions—most of which are technically known as Principal, Credentials, and Authorities, respectively."

    即:Authentication在认证请求时用到,也可在层次间传递。最常见的场景就是登录,登录中的name、password、permission,对于过来就是Authentication的Principal、Credentials、Authorities。如下图2所示:

                                                                          图2 Authentication的类图

参考:

  1. Carlo Scarioni, Pro Spring Security.

(adsbygoogle = window.adsbygoogle || []).push({});

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018/09/06 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档