如何在Spring授权服务器中为同意添加到期时间?

huangapple go评论45阅读模式
英文:

how to add expire to a consent in spring-authorization-server?

问题

当我同意授权时,我永远不需要重新授权。

我希望它在一段时间内有效(比如一个月)。

如何实现这一点?

英文:

when I agreed to an authorization,I never need to re authorize.

I want it will be valid for a period of time(like one month).

How to achieve it?

答案1

得分: 0

一种实现这个的方法是实现一个自定义的 OAuth2AuthorizationConsentService,并将同意存储在 Redis 中,带有 TTL(生存时间)。

英文:

One way to achieve this would to be implement a custom OAuth2AuthorizationConsentService that stores the consent in Redis with a TTL (time-to-live).

huangapple
  • 本文由 发表于 2023年7月24日 15:14:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76752158.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定