Skip to content

Commit

Permalink
Show claims.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-chumakov committed Feb 28, 2017
1 parent 6b0ea51 commit 390f052
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public async Task<IActionResult> Login(LoginViewModel vm, string returnUrl = nul
{
var claims = new List<Claim>
{
new Claim(ClaimTypes.Webpage, "http://goo.gl", ClaimValueTypes.String),
new Claim(ClaimTypes.Name, "Fake User"),
new Claim("age", "25", ClaimValueTypes.Integer),
new Claim("permission-foo", "grant")
Expand Down
12 changes: 11 additions & 1 deletion src/PaperSource.AspNetCoreAuthorization/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@{
@using System.Security.Claims
@{
ViewData["Title"] = "Home Page";
}
<br />
Expand Down Expand Up @@ -38,3 +39,12 @@
@Html.ActionLink("ExampleV2", "ExampleV2", "Permission")
</div>
</div>

<br/>
<br/>

<h4>User's claims:</h4>
@foreach (Claim claim in User.Claims)
{
<b>@claim.Type:</b> @claim.Value <br />
}

0 comments on commit 390f052

Please sign in to comment.