Skip to content

Commit 332f17f

Browse files
committed
added custom (Wissance) claimtypes and added UserId claim to AuthenticationResult
1 parent bdfa73e commit 332f17f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Wissance.Authorization/Wissance.Authorization/Authentication/OpenIdAuthenticationHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
6060
{
6161
new Claim(ClaimTypes.NameIdentifier, userInfo.UserName),
6262
new Claim(ClaimTypes.Name, userInfo.FullName)
63-
//new Claim(ClaimTypes.Email, null),
6463
};
6564

6665
if (userInfo.UserId != null)
6766
{
68-
//claims.Add(new Claim(ClaimTypes.));
67+
claims.Add(new Claim(Wissance.Authorization.Claims.ClaimTypes.UserId, userInfo.UserId));
6968
}
7069

7170
if (userInfo.Email != null)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Wissance.Authorization.Claims
2+
{
3+
public class ClaimTypes
4+
{
5+
public const string UserId = "id";
6+
}
7+
}

0 commit comments

Comments
 (0)