简体   繁体   English

使用Spring实现基于令牌的授权的最佳方法是什么?

[英]What is the best way to achieve token based authorization using Spring?

I am working with Spring 4 and am using Spring security and my goal is to have token based authorization with tokens granted upon successful login. 我正在使用Spring 4,并且正在使用Spring安全性,我的目标是获得基于令牌的授权,并在成功登录后授予令牌。 I've done a lot of research and different people do different things. 我做了很多研究,不同的人做不同的事情。 Some people create filters and their own token classes, and basically do a lot of heavy lifting. 有些人创建了过滤器和自己的令牌类,并且基本上做了很多繁重的工作。 During my research I stumbled upon remember me in Spring, and I was easily able to implement what I wanted. 在研究期间,我偶然发现了我在春天的记忆,并且我很容易就能实现自己想要的东西。 Is this the best approach? 这是最好的方法吗? Does Spring really do everything for you? Spring真的为您做一切吗?

Check Spring Security OAuth . 检查Spring Security OAuth Navigate through examples. 浏览示例。 Also read OAuth2 spec . 另请参阅OAuth2规范 It is difficult use any OAuth library without understanding the spec. 在不了解规范的情况下,很难使用任何OAuth库。

Spring OAuth将为您提供各种类型的身份验证机制。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Spring中实现线程功能的最佳方法 - Best way to achieve thread functionality in Spring 没有在Spring中实现UserDetailsS​​ervice接口的方法,有没有办法实现认证和授权 - Is there any way to achieve authentication and authorization without implementing UserDetailsService interface in Spring 在Tomcat上使用多个WAR的基于Spring的SOA,实现URL映射的最佳方法是什么? - Spring based SOA using multiple WAR on Tomcat, what is the best way to enfore URL mapping? 使用 Spring 从 Mongo 检索任何对象的最佳方法是什么? - What is the best way to retrieve any object from Mongo using Spring? 使用Spring和Maven时,将代码部署到服务器的最佳方法是什么? - When using Spring and Maven, what is the best way to deploy the code to the server? 使用Spring进行http url轮询的最佳方法是什么? - What would be the best way to do http url polling using Spring? 在 Spring 安全性中会话超时时,处理请求中发现的无效 CSRF 令牌的最佳方法是什么 - What is the best way to handle Invalid CSRF token found in the request when session times out in Spring security 使用 Spring Security 基于角色的授权 - role based authorization using spring security 实现基于令牌的身份验证的最佳方法是什么 - What is the best approach to implement token based authentication 根据每行中的第一个标记比较 2 个大文件的最佳方法是什么? - What is the best way to compare 2 large files based off of the first token in each line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM