以下是我的startup.cs中的客户端配置:
var mySPAClient = new IdentityServer4.Models.Client()
{
AccessTokenLifetime = accessTokenLifetime,
RedirectUris =
{
$"{host}/authentication/login-callback",
$"{host}/silent-refresh.html"
},
PostLogoutRedirectUris =
{
$"{host}/authentication/logout-callback"
},
ClientId = "projectName.web",
AllowedScopes =
{
"projectName.webAPI",
"openid",
"profile"
},
ClientName = "projectName.web",
RequireConsent = false,
AllowedGrantTypes =
{
IdentityModel.OidcConstants.GrantTypes.Implicit
},
AllowAccessTokensViaBrowser = true,
};
但是现在当我升级到预览8时,对于任何预览7的程序集,在日志中出现以下错误:
[10:55:34 错误] 客户端的授权类型无效: "authorization_code" AuthorizeRequestValidationLog { ClientId: "projectName.web", ClientName: "projectName.web", RedirectUri: "https://localhost:44343/authentication/login-callback", AllowedRedirectUris: ["https://localhost:44343/authentication/login-callback", "https://localhost:44343/silent-refresh.html"], SubjectId: "anonymous", ResponseType: "code", ResponseMode: "query", GrantType: "authorization_code", RequestedScopes: "", State: "a1e84334a8c94b7db599ddb9336447c8", UiLocales: null, Nonce: null, AuthenticationContextReferenceClasses: null, DisplayMode: null, PromptMode: null, MaxAge: null, LoginHint: null, SessionId: null, Raw: [("client_id": "projectName.web"), ("redirect_uri": "https://localhost:44343/authentication/login-callback"), ("response_type": "code"), ("scope": "projectName.webAPI openid profile"), ("state": "a1e84334a8c94b7db599ddb9336447c8"), ("code_challenge": "E8p1sg1Y0TdbhxccGB-_fbx7D6GnJXfCpcYu1IHZC_k"), ("code_challenge_method": "S256"), ("prompt": "none")] } (IdentityServer4.Validation.AuthorizeRequestValidator) [10:55:34 错误] 请求验证失败 (IdentityServer4.Endpoints.AuthorizeEndpoint)
我不知道为什么现在会涉及到“authorization_code”,并出现此错误?
感谢任何帮助。