Skip to content

Update IJwtBearerService claims type and JwtBearer versions#197

Merged
marcominerva merged 1 commit into
masterfrom
develop
Jun 10, 2026
Merged

Update IJwtBearerService claims type and JwtBearer versions#197
marcominerva merged 1 commit into
masterfrom
develop

Conversation

@marcominerva

Copy link
Copy Markdown
Owner

Changed claims parameter to IEnumerable? in IJwtBearerService for greater flexibility. Updated obsolete CreateToken to call CreateTokenAsync synchronously. Bumped Microsoft.AspNetCore.Authentication.JwtBearer package versions for .NET 8, 9, and 10 targets.

Changed claims parameter to IEnumerable<Claim>? in IJwtBearerService for greater flexibility. Updated obsolete CreateToken to call CreateTokenAsync synchronously. Bumped Microsoft.AspNetCore.Authentication.JwtBearer package versions for .NET 8, 9, and 10 targets.
Copilot AI review requested due to automatic review settings June 10, 2026 15:30
@marcominerva marcominerva merged commit dc641de into master Jun 10, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the JWT bearer abstractions by broadening the claims parameter type in IJwtBearerService and bumps Microsoft.AspNetCore.Authentication.JwtBearer package versions per target framework.

Changes:

  • Updated IJwtBearerService.CreateToken/CreateTokenAsync to accept IEnumerable<Claim>? instead of IList<Claim>?.
  • Kept the obsolete CreateToken implementation as a synchronous wrapper over CreateTokenAsync.
  • Bumped Microsoft.AspNetCore.Authentication.JwtBearer package versions for net8.0, net9.0, and net10.0.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/SimpleAuthentication.Abstractions/SimpleAuthentication.Abstractions.csproj Updates JwtBearer package versions per TFM.
src/SimpleAuthentication.Abstractions/JwtBearer/IJwtBearerService.cs Broadens claims parameter type to IEnumerable<Claim>? on token creation APIs.

/// <returns>The JWT bearer token.</returns>
/// <exception cref="ArgumentException"><paramref name="absoluteExpiration"/> is &lt; DateTime.UtcNow.</exception>
Task<string> CreateTokenAsync(string userName, IList<Claim>? claims = null, string? issuer = null, string? audience = null, DateTime? absoluteExpiration = null);
Task<string> CreateTokenAsync(string userName, IEnumerable<Claim>? claims = null, string? issuer = null, string? audience = null, DateTime? absoluteExpiration = null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants