【发布时间】:2018-02-27 07:23:45
【问题描述】:
我有一个基于 quick start sample 的基本 Identityserver4 实现。
在我的创业中,我有以下几点:
public void ConfigureServices(IServiceCollection services)
{
// configure identity server with in-memory stores, keys, clients and scopes
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddInMemoryApiResources(Config.GetApiResources())
.AddInMemoryClients(Config.GetClients());
}
public void Configure(IApplicationBuilder app)
{
...
app.UseIdentityServer();
}
我想扩展 IdentityServer4 工作流程,以便在生成访问令牌后,我可以运行业务逻辑(基于访问令牌中的声明)并修改发送给调用客户端的响应。我尝试创建一个 .NET 核心中间件,但似乎 IdentityServer 中间件使管道的其余部分短路(将执行 UseIdentityServer 之后没有中间件位置)。
我可以使用 Identityserver4 中的任何扩展方法来始终修改 IdentityServer4 发出的响应吗?我正在使用凭据授予。本质上,一旦 IdentityServer4 完成其工作流程,我想运行一些业务逻辑来修改发送给客户端的响应
【问题讨论】:
标签: asp.net-core asp.net-web-api2 identityserver4