我正在使用身份服务器 4,需要让我的用户访问另一端。我已经在第三方网站上为 SSO 配置了我的应用程序,所以我的应用程序充当该第三方网站的服务提供商,具有 auth 2.0 流程。
new Client
{
ClientId = "ClientId",
ClientName = "ClientName",
ClientSecrets = new List<Secret> {new Secret("secret".Sha256())},
AllowedGrantTypes = { GrantType.AuthorizationCode},
RedirectUris = new List<string> { "https://pubhive.myfreshworks.com/sp/OAUTH/312319274297315477/callback" },
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
},
AlwaysIncludeUserClaimsInIdToken = true,
AllowOfflineAccess = true,
RequirePkce = false,
AllowPlainTextPkce = false,
AlwaysSendClientClaims = true,
AccessTokenLifetime = 60*60
}
我的 Api 来源
new ApiResource("ClientId")
{
Scopes = new List<string>{ IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email},
UserClaims = new List<string>{ StandardScopes.Email},
ApiSecrets = new List<Secret>{ new Secret("PubhiveAPISecretKey777".Sha256()) }
}
以下来自邮递员的 Auth 2.0 流程:
并出现“invalid_client”错误,如下图所示
如下所示的请求(也尝试添加 client_secret):
给我同样的“invalid_client”错误,现在我坚持这个,auth flow is without pkce.