Kommentare zur Dokumentation hinzugefügt und Pakete konfiguriert.
This commit is contained in:
@@ -81,6 +81,16 @@ namespace DigitalData.Core.Application
|
||||
.AddScoped<IDirectorySearchService, DirectorySearchService>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the JWT service to the <see cref="IServiceCollection"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="TClaimValue">The type of the claim value used in the JWT token.</typeparam>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> to add the service to.</param>
|
||||
/// <param name="tokenDescriptorFactory">A function that takes a claim value of type <typeparamref name="TClaimValue"/> and returns a <see cref="SecurityTokenDescriptor"/> used to configure the JWT token.</param>
|
||||
/// <returns>The original <see cref="IServiceCollection"/> instance, allowing further configuration.</returns>
|
||||
/// <remarks>
|
||||
/// This method adds the necessary services for handling JWT tokens. The <paramref name="tokenDescriptorFactory"/> function is used to generate the <see cref="SecurityTokenDescriptor"/> which is essential for creating the JWT tokens.
|
||||
/// </remarks>
|
||||
public static IServiceCollection AddJWTService<TClaimValue>(this IServiceCollection services, Func<TClaimValue, SecurityTokenDescriptor> tokenDescriptorFactory)
|
||||
{
|
||||
return services.AddScoped<IJWTService<TClaimValue>, JWTService<TClaimValue>>(provider => new (tokenDescriptorFactory));
|
||||
|
||||
Reference in New Issue
Block a user