.Validation.ClientSecretValidator.ValidateAsync(HttpContext context) in C:\local\identity\server4\IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context) in C:\local\identity\server4\IdentityServer4\server4\IdentityServer4\src\IdentitySe
我在Blazor .net 3.1中启动了一个应用程序,我遇到了问题。在启动应用程序时,我希望添加一个具有管理角色(root)的用户。我在用EF。添加用户可以工作,但是添加角色会引发异常。
System.AggregateException : 'No service for type 'Microsoft.AspNetCore.Identity.RoleManager'1[Microsoft.AspNEtCore.Identity.Identity
首先,我在ApplicationDbContext中添加了角色: public class ApplicationDbContext : ApiAuthorizationDbContext<ApplicationUserADMIN", Id = Guid.NewGuid().ToString(), ConcurrencyStamp = Guid.NewGuid().ToString() });} 然后,我在启动类中向.AddIdentityServerJwt();
services.A