tVo*_*s42 6 c# asp.net-web-api asp.net-identity identityserver3
目前我有一个运行完美的身份服务器,但我想在其上添加一个API,以通过Web前端进行一些数据库配置更改.文档中的示例显示了如何使用MVC,而不是WebAPI.
Startup.Configuration方法如下所示:
app.UseIdentityServer(new IdentityServerOptions{ ... });
...
app.Map("/api", apiApp =>
{
apiApp.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "https://localhost:44300", // URL of identity server
});
});
Run Code Online (Sandbox Code Playgroud)
但是,当app.Map被调用时,它会抛出一个错误,因为它无法到达身份服务器,可能是因为它还没有启动.我怎样才能让他们一起工作?
tVo*_*s42 13
当我在StackOverflow上发帖时总是会发生这种情况,我在发布后几秒就知道了!对于其他任何有这个问题的人来说
IdentityServerBearerTokenAuthenticationOptions
组
DelayLoadMetadata = true
一切都会顺利进行!
| 归档时间: |
|
| 查看次数: |
1858 次 |
| 最近记录: |