Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable email confirmation when user creates an account in mvc asp identity

I need to disable the email confirmation when a user creates an account in MVC asp.net identity 2.0

like image 872
Lucy Avatar asked Feb 17 '16 19:02

Lucy


People also ask

What is AspNet identity?

ASP.NET Identity is Microsoft's user management library for ASP.NET. It includes functionality such as password hashing, password validation, user storage, and claims management. It usually also comes with some basic authentication, bringing its own cookies and multi-factor authentication to the party.


1 Answers

Use the following when configuring aspnet identity in the startup

In ConfigureServices()

services.AddIdentity<ApplicationUser, IdentityRole>(config =>
{
   config.SignIn.RequireConfirmedEmail = false;
})

Aspnet identity will then not check the EmailConfirmed flag when validating credentials during sign-in.

like image 162
tstojecki Avatar answered Sep 26 '22 01:09

tstojecki