- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用身份服务器授权我的 angular 客户端。以下是我的 Angular 客户端的设置。
authority: 'http://localhost:5000',
client_id: 'clientid',
redirect_uri: 'https://localhost:44384/auth-callback',
post_logout_redirect_uri: 'https://localhost:44384/',
response_type: "code",
scope: "openid profile",
filterProtocolClaims: true,
loadUserInfo: true,
automaticSilentRenew: true,
silent_redirect_uri: 'http://localhost:44384/silent-refresh.html'
IdentityServer端注册了类似的客户端。
new Client
{
ClientId = "clientid",
AllowedScopes = { "openid", "profile" },
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
RequireClientSecret = false,
AllowAccessTokensViaBrowser = true,
AllowOfflineAccess = false,
AccessTokenLifetime = 3600,
RedirectUris={"https://localhost:44384/auth-callback" },
PostLogoutRedirectUris= {"https://localhost:44384/" },
RequireConsent= false
}
它工作正常。但是当我将相同的客户端设置移动到数据库时,它给了我
客户端的授权类型无效 .
[15:15:56 Debug] IdentityServer4.EntityFramework.Stores.ClientStore
clientid found in database: True
[15:15:56 Debug] IdentityServer4.Stores.ValidatingClientStore
client configuration validation for client clientid succeeded.
[15:15:56 Debug] IdentityServer4.Validation.AuthorizeRequestValidator
Checking for PKCE parameters
[15:15:56 Error] IdentityServer4.Validation.AuthorizeRequestValidator: Invalid grant type for client: authorization_code
客户端的数据库数据如下。
最佳答案
我已经想通了。 GrantType
我在数据库中提到是错误的。
从内存中获取客户端时,我正在编写以下代码。即来自 appsettings.json
文件
new Client
{
-------
-------
AllowedGrantTypes = GrantTypes.Code,
--------
--------
}
后来当我将此信息移至数据库时,我错误地使用了相同的
grantType
即
Code
,这是错误的。它应该定义为
authorization_code
.
GrantType
在来自
Code
的数据库中至
authorization_code
.修复了我的问题。
关于angular - 身份服务器 4 : Invalid grant type for client: authorization_code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61385126/
对于 Postman 中的许多集合,我们使用授权类型 =授权代码(到 Azure)。对于使用授权类型客户端凭据的请求,我可以编写自动获取 token 的预请求脚本(如果需要),并且我希望有一个用于授权
我的项目是 python 并使用 boto3 库。 我正在使用 aws cognito 授权代码授予流程和 return_type=code 而不是 return_type=token(隐式流程)。一
我正在使用 spring boot oauth2 尝试设置授权代码授予流程。授权端点工作,生成代码并将其存储在我们的 postgres 存储中。但是,使用代码获取 token 的第二步不起作用。 我没
我正在开发 API AI 代理,并尝试实现帐户链接功能。文档位于 oauth2-codeflow真的很有帮助,我能够创建我的 oauth 流程并在 Google playground 中进行测试。 .
我正在尝试使用身份服务器授权我的 angular 客户端。以下是我的 Angular 客户端的设置。 authority: 'http://localhost:5000', client_id
我有 3 个应用程序 前端应用 OAuth2 身份验证服务器 REST API(RepositoryRestResources) 我的用户必须先登录才能使用前端应用程序。这是通过 SSO 实现的。他们
代码片段为 帖子网址为 https://accounts.google.com/o/oauth2/token 范围是“https://www.googleapis.com/auth/userinfo.
据我了解,在授权代码流程中,我们需要获取授权代码并在之后使用它来获取 token 。只有当用户确认指定访问权限时,我们才能获得此代码。之后浏览器将我们重定向到 redirect_uri 并且响应将包含
我正在用 django 开发一个应用程序,当我尝试使用 auth0 登录时,我得到: "error": { "message": "Grant type 'authorization_code'
我正在尝试使用 authorization_code 授权流程设置身份验证。我之前曾使用过 grant_type=password ,所以我知道这些东西应该如何工作。但是当使用 grant_type=
我正在尝试创建一个简单的支持 OAuth 的概念验证应用程序,但卡在授权代码实现上。我读到的所有地方似乎都以这样或那样的方式进行,从未真正使用过授权代码流。我一直在使用以下资源获取信息: https:
我正处于 Authorization Code Grant Flow 之中使用 Azure AD。尽管文档说 grant_type 应该是 authorization_code,但我收到了有关此属性的
我是一名优秀的程序员,十分优秀!