Skip to content

Commit

Permalink
Add uid claim with value equal to subjectId
Browse files Browse the repository at this point in the history
  • Loading branch information
nielses committed May 16, 2023
1 parent 9bc01fb commit 84157e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Services/ProfileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Services;
using Duende.IdentityServer.Test;
using System.Security.Claims;
using IdentityModel;

namespace OpenIdConnectServer.Services
{
Expand All @@ -24,9 +26,15 @@ public Task GetProfileDataAsync(ProfileDataRequestContext context)
if (user != null)
{
Logger.LogDebug("The user was found in store");
var claims = context.FilterClaims(user.Claims);
context.AddRequestedClaims(claims);
var claims = new List<Claim>
{
new Claim("uid", subjectId),
};
Logger.LogDebug("Adding claims {claims}", claims);
context.IssuedClaims.AddRange(claims);
}


return Task.CompletedTask;
}

Expand Down

0 comments on commit 84157e7

Please sign in to comment.