在 Microsoft IdentityServer4 中调用 Introspection 端点的正确方法是什么

What's the right way to call Introspect endpoint in Microsoft IdentityServer 4

我可以使用 postman 从 Microsoft Identity Server 4 获取访问令牌。

这是回应:

现在我想使用内省端点对令牌进行身份验证,但是 return 是 401 unhautorized,也许在内省端点的请求中缺少一些数据?

要访问 Postman 中的令牌内省点,我使用:

  • POST 到 https://localhost:6001/connect/introspect
  • 添加授权 header,值为“Basic cGF5bWVudDpteWFwaXNlY3JldA==”。其中的秘密是apiname/secret。在我的例子中,它是付款和 myapisecret 作为密码。
  • 添加一个 body x-www-form-urlencoded,键名为 token,值为我的访问令牌。

应该就这些了。