“ InvalidOperationException:方案已经存在:Identity.Application”

时间:2018-07-18 11:21:01

标签: mongodb asp.net-core asp.net-identity identityserver4 usertokenprovider

我正在尝试使用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();

0 个答案:

没有答案