[英]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.