Skip to content
This repository was archived by the owner on Apr 27, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/SimpleTokenProvider/TokenProviderMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -87,6 +88,10 @@ private async Task GenerateToken(HttpContext context)
new Claim(JwtRegisteredClaimNames.Iat, ToUnixEpochDate(now).ToString(), ClaimValueTypes.Integer64)
};

// Combine claims from IdentityResolver with Jwt registered claims.
var claimsList = identity.Claims.ToList();
claimsList.AddRange(claims);

// Create the JWT and write it to a string
var jwt = new JwtSecurityToken(
issuer: _options.Issuer,
Expand Down