refactor(DIExtensions): Methode AddJwtSignatureHandler hinzugefügt

This commit is contained in:
Developer 02 2025-01-06 16:08:45 +01:00
parent 8ccf6f31ae
commit 8850ac4ac9

View File

@ -60,5 +60,9 @@ namespace DigitalData.Core.Security
return services.AddSingleton(sp => Options.Create(descriptor));
}
public static IServiceCollection AddJwtSignatureHandler<TPrincipal>(this IServiceCollection services, Func<TPrincipal, IDictionary<string, object>>? claimsMapper = null, Func<TPrincipal, ClaimsIdentity>? subjectMapper = null) => services
.AddClaimDescriptor(claimsMapper: claimsMapper, subjectMapper: subjectMapper)
.AddSingleton<IJwtSignatureHandler<TPrincipal>, JwtSignatureHandler<TPrincipal>>();
}
}