gpt4 book ai didi

oauth-2.0 - AWS Cognito 的 token 自省(introspection)路径是什么

转载 作者:行者123 更新时间:2023-12-04 15:20:36 25 4
gpt4 key购买 nike

我们正在使用 vertx oauth2 组件来实现使用 oauth2 授权码授予的 cognito 登录。我们可以使用现有的 API 来实现该场景。但是 vertx 在它的 oauth2 配置中期望 token 自省(introspection)路径。否则无法从 cognito 询问提供给资源服务器的 token 是否正确。无论如何,我们无法在 Cognito 文档中找到有关什么是 token 自省(introspection)上下文路径的任何信息。

OAuth2ClientOptions oAuth2ClientOptions = new OAuth2ClientOptions()
.setClientID("***************************")
.setIntrospectionPath("") //what should goes here
.setClientSecret("********************")
.setSite("*****************")
.setTokenPath("/oauth2/token")
.setAuthorizationPath("/oauth2/authorize")
.setFlow(OAuth2FlowType.AUTH_CODE)

最佳答案

AWS Cognito 没有内省(introspection)端点,因此您必须使用不同的方法:

  • 从 JWKS 端点下载 token 签名 key
  • 使用库来验证 token 签名

  • 如果有帮助,这里有一些 nodejs code of mine验证 Cognito token 。
    我没有用过 vertx 但它似乎支持 JWT Validation .通常这涉及在 Options 对象中包含 JWKS 或元数据 URL。

    关于oauth-2.0 - AWS Cognito 的 token 自省(introspection)路径是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63409343/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com