From af7385678f84773f5ff88969a498ca6de16c1fe3 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 24 Sep 2024 10:55:41 +0200 Subject: [PATCH] Added more AccessToken providing options --- HopFrame.Security/Authentication/HopFrameAuthentication.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HopFrame.Security/Authentication/HopFrameAuthentication.cs b/HopFrame.Security/Authentication/HopFrameAuthentication.cs index e688096..8232d4c 100644 --- a/HopFrame.Security/Authentication/HopFrameAuthentication.cs +++ b/HopFrame.Security/Authentication/HopFrameAuthentication.cs @@ -29,6 +29,8 @@ public class HopFrameAuthentication( protected override async Task HandleAuthenticateAsync() { var accessToken = Request.Cookies[ITokenContext.AccessTokenType]; + if (string.IsNullOrEmpty(accessToken)) accessToken = Request.Headers[SchemeName]; + if (string.IsNullOrEmpty(accessToken)) accessToken = Request.Headers["Token"]; if (string.IsNullOrEmpty(accessToken)) return AuthenticateResult.Fail("No Access Token provided"); var tokenEntry = await context.Tokens.SingleOrDefaultAsync(token => token.Token == accessToken);