Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将IdentityServer4 v2升级到v3作用域错误_Identityserver4_Asp.net Core Identity_Asp.net Core 3.1 - Fatal编程技术网

将IdentityServer4 v2升级到v3作用域错误

将IdentityServer4 v2升级到v3作用域错误,identityserver4,asp.net-core-identity,asp.net-core-3.1,Identityserver4,Asp.net Core Identity,Asp.net Core 3.1,我使用identity server从以前的core 2项目中获取了旧的配置代码,并将其移动到新的core 3.1项目中。一切似乎都在运行,数据库已经创建,到目前为止大多数东西都“看起来”正常。我遇到的第一个问题是命中令牌端点时出现范围错误。我得到一个无效的作用域错误。我不确定这为什么不起作用,这是调用/connect/token的日志 [19:34:49 Debug] IdentityServer4.Hosting.EndpointRouter Request path /connect/to

我使用identity server从以前的core 2项目中获取了旧的配置代码,并将其移动到新的core 3.1项目中。一切似乎都在运行,数据库已经创建,到目前为止大多数东西都“看起来”正常。我遇到的第一个问题是命中令牌端点时出现范围错误。我得到一个无效的作用域错误。我不确定这为什么不起作用,这是调用/connect/token的日志

[19:34:49 Debug] IdentityServer4.Hosting.EndpointRouter
Request path /connect/token matched to endpoint type Token
[19:34:49 Debug] IdentityServer4.Hosting.EndpointRouter
Endpoint enabled: Token, successfully created handler: IdentityServer4.Endpoints.TokenEndpoint
[19:34:49 Information] IdentityServer4.Hosting.IdentityServerMiddleware
Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token
[19:34:49 Debug] IdentityServer4.Endpoints.TokenEndpoint
Start token request.
[19:34:49 Debug] IdentityServer4.Validation.ClientSecretValidator
Start client validation
[19:34:49 Debug] IdentityServer4.Validation.BasicAuthenticationSecretParser
Start parsing Basic Authentication secret
[19:34:49 Debug] IdentityServer4.Validation.PostBodySecretParser
Start parsing for secret in post body
[19:34:49 Debug] IdentityServer4.Validation.SecretParser
Parser found secret: PostBodySecretParser
[19:34:49 Debug] IdentityServer4.Validation.SecretParser
Secret id found: myapp_mobile
[19:34:49 Debug] IdentityServer4.EntityFramework.Stores.ClientStore
myapp_mobile found in database: True
[19:34:49 Debug] IdentityServer4.Stores.ValidatingClientStore
client configuration validation for client myapp_mobile succeeded.
[19:34:49 Debug] IdentityServer4.Validation.SecretValidator
Secret validator success: HashedSharedSecretValidator
[19:34:49 Debug] IdentityServer4.Validation.ClientSecretValidator
Client validation success
[19:34:49 Information] IdentityServer4.Events.DefaultEventService
{"ClientId": "myapp_mobile", "AuthenticationMethod": "SharedSecret", "Category": "Authentication", "Name": "Client Authentication Success", "EventType": "Success", "Id": 1010, "Message": null, "ActivityId": "80000020-0000-fe00-b63f-84710c7967bb", "TimeStamp": "2020-02-08T00:34:49.0000000Z", "ProcessId": 22424, "LocalIpAddress": "10.37.129.3:443", "RemoteIpAddress": "10.37.129.2", "$type": "ClientAuthenticationSuccessEvent"}
[19:34:49 Debug] IdentityServer4.Validation.TokenRequestValidator
Start token request validation
[19:34:49 Debug] IdentityServer4.Validation.TokenRequestValidator
Start resource owner password token request validation
[19:34:49 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore
Found [] identity scopes in database
[19:34:49 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore
Found ["myapp_api_resource", "myapp_api"] API scopes in database
[19:34:49 Error] IdentityServer4.Validation.ScopeValidator
Requested scope not allowed: email
[19:34:49 Error] IdentityServer4.Validation.TokenRequestValidator
{"ClientId": "myapp_mobile", "ClientName": "myapp Mobile App", "GrantType": "password", "Scopes": null, "AuthorizationCode": null, "RefreshToken": null, "UserName": null, "AuthenticationContextReferenceClasses": null, "Tenant": null, "IdP": null, "Raw": {"client_id": "myapp_mobile", "client_secret": "***REDACTED***", "username": "testguy1", "password": "***REDACTED***", "grant_type": "password"}, "$type": "TokenRequestValidationLog"}
[19:34:49 Information] IdentityServer4.Events.DefaultEventService
{"ClientId": "myapp_mobile", "ClientName": "myapp Mobile App", "RedirectUri": null, "Endpoint": "Token", "SubjectId": null, "Scopes": null, "GrantType": "password", "Error": "invalid_scope", "ErrorDescription": null, "Category": "Token", "Name": "Token Issued Failure", "EventType": "Failure", "Id": 2001, "Message": null, "ActivityId": "80000020-0000-fe00-b63f-84710c7967bb", "TimeStamp": "2020-02-08T00:34:49.0000000Z", "ProcessId": 22424, "LocalIpAddress": "10.37.129.3:443", "RemoteIpAddress": "10.37.129.2", "$type": "TokenIssuedFailureEvent"}

我知道“请求范围不允许:电子邮件”,我不知道为什么。我不要求任何范围,所以我应该收到所有范围。这是我错过的asp.net核心身份设置吗?client scopes表中有我客户的电子邮件,因此任何帮助都会很好


谢谢。

如果其他人有这个问题,答案很简单


可能是在旧设置的某个地方,我手动将IdentityResource配置添加到数据库中,或者他们从未将其添加到最终的数据库种子代码中。一旦我添加了这些标记,令牌端点就开始工作。

谁会将其降级,至少不发表评论?