Getting Started With ASP.NET Core 2.0 Identity And Role Management

In this article, we will see in detail how to use ASP.NET Core Identity in MVC Application for creating user roles and displaying the menu depending on user roles.

C# (2.1 MB)
 
 
 
 
 
5 Star
(1)
1,350 times
Add to favorites
3/22/2018
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
@model LoginWithRecoveryCodeViewModel
@{
    ViewData["Title"] = "Recovery code verification";
}

<h2>@ViewData["Title"]</h2>
<hr />
<p>
    You have requested to login with a recovery code. This login will not be remembered until you provide
    an authenticator app code at login or disable 2FA and login again.
</p>
<div class="row">
    <div class="col-md-4">
        <form method="post">
            <div asp-validation-summary="All" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="RecoveryCode"></label>
                <input asp-for="RecoveryCode" class="form-control" autocomplete="off" />
                <span asp-validation-for="RecoveryCode" class="text-danger"></span>
            </div>
            <button type="submit" class="btn btn-default">Log in</button>
        </form>
    </div>
</div>

@section Scripts {
    @await Html.PartialAsync("_ValidationScriptsPartial")
}