aboutsummaryrefslogtreecommitdiff
path: root/libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-06-22 21:13:35 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-06-22 21:13:35 -0400
commite484f5478eee916c500a730cceb6cf448c959ce7 (patch)
tree8b644036ffa4a4a1481f4f7fb08a9ef52faa8948 /libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs
parent9ef2116e7be2c04632b8958eb6184632c3d8f975 (diff)
Extensions async updates
Diffstat (limited to 'libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs')
-rw-r--r--libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs b/libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs
index 2552d98..c4c5128 100644
--- a/libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs
+++ b/libs/VNLib.Plugins.Sessions.OAuth/src/Endpoints/AccessTokenEndpoint.cs
@@ -51,7 +51,7 @@ namespace VNLib.Plugins.Sessions.OAuth.Endpoints
{
private readonly IApplicationTokenFactory TokenFactory;
private readonly ApplicationStore Applications;
- private readonly Task<ReadOnlyJsonWebKey?> JWTVerificationKey;
+ private readonly IAsyncLazy<ReadOnlyJsonWebKey?> JWTVerificationKey;
//override protection settings to allow most connections to authenticate
///<inheritdoc/>
@@ -73,7 +73,7 @@ namespace VNLib.Plugins.Sessions.OAuth.Endpoints
Applications = new(pbase.GetContextOptions(), pbase.GetOrCreateSingleton<ManagedPasswordHashing>());
//Try to get the application token key for verifying signed application JWTs
- JWTVerificationKey = pbase.TryGetSecretAsync("application_token_key").ToJsonWebKey();
+ JWTVerificationKey = pbase.TryGetSecretAsync("application_token_key").ToJsonWebKey().AsLazy();
}
@@ -140,7 +140,7 @@ namespace VNLib.Plugins.Sessions.OAuth.Endpoints
private UserApplication? GetApplicationFromJwt(string jwtData)
{
- ReadOnlyJsonWebKey? verificationKey = JWTVerificationKey.GetAwaiter().GetResult();
+ ReadOnlyJsonWebKey? verificationKey = JWTVerificationKey.Value;
//Not enabled
if (verificationKey == null)