我正在尝试使用Asp.netIdentity.Mongo来实现identityServer4,并支持注册,2fa和电子邮件确认。但是我在运行代码时收到“ InvalidOperationException:方案已经存在:Identity.Application”。
services
.AddIdentityWithMongoStores(connection)
.AddDefaultMongoTokenProviders();
services.AddIdentityServer(
options =>
{
options.Events.RaiseSuccessEvents = true;
options.Events.RaiseFailureEvents = true;
options.Events.RaiseErrorEvents = true;
}
)
.AddMongoRepository()
.AddMongoDbForAspIdentity<ApplicationUser, Microsoft.AspNetCore.Identity.MongoDB.IdentityRole>(Configuration)
.AddClients()
.AddIdentityApiResources()
.AddPersistedGrants()
.AddProfileService<ProfileService>()
.AddDeveloperSigningCredential();