mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-22 21:46:58 +00:00
Shows user's name & UPN while logged In
This commit is contained in:
parent
07e31bed41
commit
0f9e0e3ee4
@ -30,6 +30,20 @@ namespace IdentityServerHost.Quickstart.UI
|
||||
new Claim(JwtClaimTypes.Email, "muhammad-azeez@outlook.com"),
|
||||
new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean),
|
||||
},
|
||||
},
|
||||
new TestUser
|
||||
{
|
||||
SubjectId = "4990102438634",
|
||||
Username = "4990102438634",
|
||||
Password = "123",
|
||||
Claims =
|
||||
{
|
||||
new Claim(JwtClaimTypes.Name, "Vazhin Tayeb"),
|
||||
new Claim(JwtClaimTypes.GivenName, "Vazhin"),
|
||||
new Claim(JwtClaimTypes.FamilyName, "Tayeb"),
|
||||
new Claim(JwtClaimTypes.Email, "vazhintayeb@gmail.com"),
|
||||
new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean),
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@
|
||||
}
|
||||
|
||||
<div class="logged-out-page">
|
||||
<h1>
|
||||
<div>
|
||||
<h1>
|
||||
Logout
|
||||
<small>You are now logged out</small>
|
||||
</h1>
|
||||
<h3 class="font-weight-light mt-3">You are now logged out</h3>
|
||||
</div>
|
||||
|
||||
@if (Model.PostLogoutRedirectUri != null)
|
||||
{
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
@using System.Diagnostics
|
||||
@using IdentityServer4.Extensions
|
||||
|
||||
@{
|
||||
var version =
|
||||
@ -9,22 +10,32 @@
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-lg-6 col-md-8">
|
||||
<div class="card p-5 justify-content-center">
|
||||
<h2 class="font-weight-normal">
|
||||
Identity Server
|
||||
</h2>
|
||||
|
||||
<p class="font-weight-normal mt-4" style="font-size: 20px;">This service is a centeralized
|
||||
authentication tool. It's used
|
||||
for
|
||||
all of the kurdistan's digital
|
||||
services.
|
||||
</p>
|
||||
|
||||
@if (User.Identity.IsAuthenticated == false)
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<h2 class="font-weight-normal">
|
||||
Welcome @User.GetDisplayName()!
|
||||
</h2>
|
||||
<p class="mt-2">Your UPN is: @User.FindFirst("sub").Value</p>
|
||||
<div>
|
||||
<a class="btn btn-primary px-4 font-weight-bold mt-5" asp-controller="Diagnostics"
|
||||
asp-action="Index" role="button">Login</a>
|
||||
<a class="btn btn-primary px-4 font-weight-bold mt-4" asp-controller="Account" asp-action="Logout"
|
||||
role="button">Logout</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h2 class="font-weight-normal">
|
||||
Identity Server
|
||||
</h2>
|
||||
|
||||
<p class="font-weight-light mt-4" style="font-size: 20px;">This service is a centeralized
|
||||
authentication tool. It's used
|
||||
for
|
||||
all of the kurdistan's digital
|
||||
services.
|
||||
</p>
|
||||
<div>
|
||||
<a class="btn btn-primary px-4 font-weight-bold mt-4" asp-controller="Account" asp-action="Login"
|
||||
role="button">Login</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user