OAUTH注销和OAuth令牌验证

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

OAUTH logout and Oauth Token Validation

问题

  1. 注销: 我在规范中没有找到可以调用以注销/使令牌无效的URL。我唯一找到的选项是编写自己的注销实现,并从该方法中删除令牌存储中的令牌。但是否有其他注销/使令牌无效的方式,就像我们检索令牌一样?

  2. 令牌验证: 是否有任何URL,我可以将我的令牌传递给它以验证令牌是否有效。一种方式是编写自己的方法来验证令牌。如果自己的方法返回200,则表示令牌有效,否则为无效令牌(401)。但我想知道,Spring OAuth是否提供了类似的URL。

英文:

I am using Spring oath to secure my RESP API's and successfully generated the oauth token. Now I am stuck in 2 place mentioned below.

  1. Logout: I didn't find any URL in specification which I can call to logout/invalidate the token. One option I got is to write own implementation of logout and delete the token from the token store from that method. But is there any other way to logout/invalidate the token like we retrieve the token.

  2. Validation of Token: Is there any url where I can pass my token and can validate that the token is valid or not. One way is to write a own method from which I will validate token. If own method returns 200 then valid token else invalid token(401). But like to know that , is Spring OAUth provide any such url.

答案1

得分: 1

最常见的用法是将Spring Security与基于标准的云授权服务器集成,此时您可以使用以下选项:

但请注意,并非所有授权服务器都以标准方式实现这些端点。

在注销时删除令牌是最标准的选项之一,同时保持令牌的寿命较短,以便它们很快过期也是常见的做法。

英文:

The most common usage is to integrate Spring security with a standards based cloud authorization server, in which case you can use these options:

Note however that not all Authorization Servers implement these endpoints in a standard way.

Deleting tokens on logout is the most standard option, along with keeping tokens short lived so that they expire soon anyway.

huangapple
  • 本文由 发表于 2020年1月3日 16:54:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575573.html
匿名

发表评论

匿名网友

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

确定