IdentityServer4使用IdentityServerTools从身份服务器内部创建令牌 [英] IdentityServer4 usage of IdentityServerTools to create a token from within identity server
问题描述
我正在使用IdentityServer4,并且有一种情况,我需要在密码重置过程中启动对安全API的调用. IdentityServer4确实提供了IdentityServerTools
以便从可扩展性点调用受保护的资源,但是目前没有文档或缩进用法的示例.
I'm using IdentityServer4 and have a scenario where I need to initiate a call to a secured API during a password reset process. IdentityServer4 does provide IdentityServerTools
for the purpose of calling a secured resource from an extensibility point, however there is currently no documentation or examples for the indented usage.
如何使用IdentityServerTools
中提供的方法创建必要的令牌?
How does one go about creating the necessary token using the provided methods in IdentityServerTools
?
推荐答案
IdentityServerTools
可从DI获得.只需将其注入您的类并调用该方法即可创建客户端令牌.
IdentityServerTools
is available from DI. Simply inject it into your class and call the method to create a client token.
https://docs.identityserver.io/en/latest/topics/tools.html
这篇关于IdentityServer4使用IdentityServerTools从身份服务器内部创建令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!