问题描述
这可能是一个愚蠢的问题,但这是:)
This may be a dumb question, but here goes :)
在此问题中,我有以下应用程序:
I have the following applications in this problem:
- IdentityServer3
- 一个使用Identityserver作为其身份验证器的WebApi2应用程序
- MVC网络应用程序
我想做的是从IdentityServer调用WebApi上的安全服务,但是为此,我需要访问令牌.
What I want to do, is to call a secured service on the WebApi from the IdentityServer, but in order to do so I require an access token.
我如何在IdentityServer中向自身发出访问令牌(该令牌将依次通过WebApi通过自身进行身份验证)
How do I within the IdentityServer issue an access token to itself (which in order will be authenticated through itself from the WebApi)
推荐答案
IdentityServer包含一个OWIN扩展方法,该方法允许直接颁发令牌-无需通过任何协议流.
IdentityServer includes an OWIN extension method that allows issuing tokens directly - no need to go through one of the protocol flows.
它称为IssueClientToken
,并记录在这里:
It is called IssueClientToken
and is documented here:
https://identityserver.github.io/Documentation/docsv2/advanced/owin.html
这篇关于如何向身份服务器本身发出访问令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!