spring - 实现 Spring OAuth2,从不同设备获取相同的访问 token

标签 spring spring-security spring-security-oauth2

实现了 Spring OAuth2 安全性,并在使用同一用户但从不同设备登录时获得相同的访问 token 。当我从这些设备中的任何一个注销(撤销 token )时,其他设备也被注销。这是预期的行为还是我遗漏了什么?希望共享大量代码不会有太大帮助,因此请保持问题简短。

最佳答案

The default behaviour of the DefaultTokenServices is to re-use existing tokens (based on the behaviour of the existing TokenStore implementations)



http://forum.spring.io/forum/spring-projects/security/oauth/121797-multiple-valid-oauth-access-tokens-for-same-client

如果您希望为每个设备提供不同的 access_token,则创建您自己的 AuthenticationKeyGenerator,例如在授权过程中发送您的设备 ID,让您的 AuthenticationKeyGenerator 处理该设备 ID 以创建特定于该设备的 access_token

关于spring - 实现 Spring OAuth2,从不同设备获取相同的访问 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32460082/

相关文章:

spring-boot - Spring 数据 R2DBC : org. springframework.data.mapping.PropertyReferenceException:找不到类型的属性 findAll

java - Oauth 2 spring RestTemplate 使用刷新 token 登录

spring-security - 撤销 JWT Oauth2 刷新 token

java - 从 View 中访问 Spring MVC BindingResult

java - Spring MVC 无法解析 .jsp 文件

java - 如何在流外访问 Spring Webflow FlowScope 元素?

spring - 404 未找到 : Angular 2 can't talk to Spring Rest API

java - Spring Security 即使使用 @PreAuthorize ("permitAll()"也会阻止匿名请求)

java - 在自定义 spring boot 登录表单上显示错误登录消息

java - OpenID Connect 的 Spring Security 5 XML 配置