+-
实现了Spring OAuth2,从不同的设备获取相同的访问令牌
实施 Spring OAuth2安全性并在使用相同用户但从不同设备进行日志记录时获取相同的访问令牌.当我从这些设备中的任何一个注销(撤销令牌)时,其他设备也会被注销.这是预期的行为还是我错过了什么?希望共享大量代码不会有太大帮助,因此这个问题简短而简单.
最佳答案

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 OAuth2,从不同的设备获取相同的访问令牌 - 乐贴网