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
WebDesktop/Backend/Security/Authentication/Handler/JwtTokenAuthenticationExtensions.cs
2022-09-04 12:03:44 +02:00

15 lines
626 B
C#

using Backend.Options;
using Microsoft.AspNetCore.Authentication;
namespace Backend.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,
_ => { });
}
}
}