Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Projekte/WebDesktop/WebDesktopBackend/Security/Authentication/Handler/JwtTokenAuthenticationExtensions.cs
2022-09-04 12:45:01 +02:00

18 lines
688 B
C#

using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Configuration;
using WebDesktopBackend.Options;
namespace WebDesktopBackend.Security.Authentication
{
public static class JwtTokenAuthenticationExtensions
{
public static AuthenticationBuilder AddJwtTokenAuthentication(this AuthenticationBuilder builder, IConfiguration configuration)
{
builder.Services.AddOptionsFromConfiguration<JwtTokenAuthenticationOptions>(configuration);
return builder.AddScheme<JwtTokenAuthenticationHandlerOptions, JwtTokenAuthenticationHandler>(
JwtTokenAuthentication.Scheme,
_ => { });
}
}
}