AddIdentity() fails “InvalidOperationException: Scheme already exists: Identity.Application”

前端 未结 7 620
闹比i
闹比i 2021-01-07 22:05

I\'m trying to add facebook login to my .NET Core 2.1 site

I\'m following this , guide and more specific, this (for facebook login)

After have adding the lines

7条回答
  •  囚心锁ツ
    2021-01-07 22:42

    if removing the "addDefaultIdentity" from "Startup.cs" does not work for you .

    Replace services.AddDefaultIdentity to AddIdentity

    Code snippet

      /*
                services.AddIdentity(options => options.SignIn.RequireConfirmedAccount = true)
                    .AddEntityFrameworkStores();
                */
                
                services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true)
                    .AddEntityFrameworkStores();
    

提交回复
热议问题