This commit is contained in:
parent
892101a84d
commit
0f1f900055
@ -1,8 +1,5 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
|
|
||||||
namespace OpenHarbor.JwtTokenManager;
|
namespace OpenHarbor.JwtTokenManager;
|
||||||
|
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
|
|
||||||
public class JwtTokenManagerOptions
|
public class JwtTokenManagerOptions
|
||||||
{
|
{
|
||||||
public required string TokenEndpoint { get; set; }
|
public required string TokenEndpoint { get; set; }
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text.Json;
|
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using OpenHarbor.JwtTokenManager.Abstractions;
|
using OpenHarbor.JwtTokenManager.Abstractions;
|
||||||
|
@ -22,8 +22,7 @@ public static class ServiceCollectionExtensions
|
|||||||
if (string.IsNullOrWhiteSpace(sectionName))
|
if (string.IsNullOrWhiteSpace(sectionName))
|
||||||
throw new ArgumentException("Section name must be provided.", nameof(sectionName));
|
throw new ArgumentException("Section name must be provided.", nameof(sectionName));
|
||||||
|
|
||||||
var section = configuration.GetSection(sectionName);
|
services.Configure<JwtTokenManagerOptions>(configuration.GetSection(sectionName));
|
||||||
services.Configure<JwtTokenManagerBuilderOptions>(section);
|
|
||||||
|
|
||||||
// Apply the builder options
|
// Apply the builder options
|
||||||
var builderOptions = new JwtTokenManagerBuilderOptions();
|
var builderOptions = new JwtTokenManagerBuilderOptions();
|
||||||
|
Loading…
Reference in New Issue
Block a user