【发布时间】:2021-04-25 04:40:41
【问题描述】:
我已尝试在 Startup.cs 上应用几种设置,如给定链接所示:
https://identityserver4.readthedocs.io/en/latest/quickstarts/2_interactive_aspnetcore.html
但不幸的是,当我检查以下 url 时,我无法设置权威参数的基本 url:
https://my-pc-id:8085/_configuration/MyApp.WebUI
似乎很奇怪,因为如果我们不能设置这个参数,为什么这个配置上有这样一个选项?
using System.IdentityModel.Tokens.Jwt;
// ...
JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies")
.AddOpenIdConnect("oidc", options =>
{
options.Authority = "my-pc-id:8085";
options.ClientId = "mvc";
options.ClientSecret = "secret";
options.ResponseType = "code";
options.SaveTokens = true;
});
【问题讨论】:
-
尝试添加 https://? options.Authority = "my-pc-id:8085"; ??
标签: c# asp.net-core .net-core jwt identityserver4