You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
987 B
31 lines
987 B
@page
|
|
@using System.Security.Claims
|
|
@{
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
gaga
|
|
|
|
@ViewBag.sessionvariable
|
|
|
|
@if (User.Identity.IsAuthenticated)
|
|
{
|
|
|
|
ClaimsPrincipal user = User;
|
|
var claimId = user.Claims.FirstOrDefault(x => x.Type == "Id");
|
|
var claimEmail = user.Claims.FirstOrDefault(x => x.Type == "Email");
|
|
var claimDisplayName = user.Claims.FirstOrDefault(x => x.Type == "DisplayName");
|
|
|
|
string userId = claimId != null ? claimId.Value : string.Empty; ;
|
|
string userEmail = claimEmail != null ? claimEmail.Value : string.Empty; ;
|
|
string userDisplayName = claimDisplayName != null ? claimDisplayName.Value : string.Empty; ;
|
|
|
|
<h6> Welcome <b style="color: red; font-size: 22px;">@User.Identity.Name</b></h6>
|
|
<ul>
|
|
<li>Id : @userId</li>
|
|
<li>Email : @userEmail</li>
|
|
<li>Display name : @userDisplayName</li>
|
|
</ul>
|
|
<p>
|
|
<a href="/employee/logout" style="text-decoration: underline;">Logout</a>
|
|
</p>
|
|
} |