Ast*_*yan 3 asp.net-identity asp.net-core identityserver4
我使用 ASP.NET Core 作为 api,但找不到配置身份以返回 401 而不是重定向到登录页面的方法。我使用 IdentityServerAuthentication 中间件。
在 Startup.cs 中,我提供了以下选项:
var options = new IdentityServerAuthenticationOptions
{
Authority = Configuration.GetConnectionString("Authority"),
ScopeName = "scopeName",
RequireHttpsMetadata = false,
};
app.UseIdentityServerAuthentication(options);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2037 次 |
| 最近记录: |