Click here to Skip to main content
15,896,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have a MVC 5 application with identity framework in which I have implemented email verification when a new user is registering to the application, however i need to bypass this when admin is creating a new user even email field should be optional as i am using mobile number to login, how i can achieve it please help.

Thank you in advance

What I have tried:

i have not came across any solution till now
Posted
Updated 23-Aug-16 12:59pm

Implement a class which derives from the SecurityProvider in .net class and customise it to behave differently for given user type.

On user login, check if this user is admin or whatever, then re-load the aspnet identity security context and provider to the relevant type with the desired implementation.

Check this link for some info on how it works, then you customise the internals of the policies.
ASP.NET Identity 2.0: Setting Up Account Validation and Two-Factor Authorization | John Atten[^]
 
Share this answer
 
Assuming you have a flag telling if a user have a registered Email.
On the Create screen for new users, add an optional CheckBox that is used to tell if Email is registered.
The checkBox being available (not hidden) to Admin only.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900