本文介绍了java.security.Principal中 - 创作HttpServletRequest和春季安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-
我无法找到的HttpServletRequest的java.security.Principal中是如何被创建 - 谁负责?它是如何做?难道一定保存在session?
-
如何将它连接到春季安全?
-
是否有任何替代Spring Security的,它使用主要为用户授权/认证?
-
如何将一个实现自己的用户授权/认证,使校长将包含当前用户?
解决方案
- 一般,主要对象将在会议上成功login.See 文档。
- 泉
验证
接口扩展主要
接口 - 另外,您可以使用
- 实施自己的
的UserDetailsService
这西港岛线返回用户对象(必须实现的UserDetails接口)请参阅文档。
I am unable to find how the java.security.Principal in HttpServletRequest is created - who is responsible? How it is done? Is it necessarily kept in Session?
How it is connected to Spring Security?
Are there any alternatives to Spring Security which uses Principal for User authorization/authentication?
How would one implement own user authorization/authentication so that Principal would contain the current user?
解决方案
- typically, Principal object putting in the session after successful login.See documentation.
- Springs
Authentication
interface extendsPrincipal
interface - Alternatively you can use Apache Shiro
- Implement own
UserDetailsService
which wil return your User object(it must implement UserDetails interface) See docs.
这篇关于java.security.Principal中 - 创作HttpServletRequest和春季安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!