From 21b874245f4cc293d6a97817307362f9933687da Mon Sep 17 00:00:00 2001 From: Charley Wu Date: Sun, 10 Dec 2023 13:04:02 +0800 Subject: [PATCH] The `ISystemClock` is obsolete since ASP.NET Core 8.0 - https://learn.microsoft.com/dotnet/core/compatibility/aspnet-core/8.0/isystemclock-obsolete --- .../CasAuthenticationHandler.cs | 7 +++++++ .../GSS.Authentication.CAS.AspNetCore.csproj | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/GSS.Authentication.CAS.AspNetCore/CasAuthenticationHandler.cs b/src/GSS.Authentication.CAS.AspNetCore/CasAuthenticationHandler.cs index dc1ff965..3610307c 100644 --- a/src/GSS.Authentication.CAS.AspNetCore/CasAuthenticationHandler.cs +++ b/src/GSS.Authentication.CAS.AspNetCore/CasAuthenticationHandler.cs @@ -12,11 +12,18 @@ namespace GSS.Authentication.CAS.AspNetCore; public class CasAuthenticationHandler : RemoteAuthenticationHandler where TOptions : CasAuthenticationOptions, new() { +#if NET8_0_OR_GREATER + public CasAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder) + : base(options, logger, encoder) + { + } +#else public CasAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) { } +#endif protected new CasEvents Events { diff --git a/src/GSS.Authentication.CAS.AspNetCore/GSS.Authentication.CAS.AspNetCore.csproj b/src/GSS.Authentication.CAS.AspNetCore/GSS.Authentication.CAS.AspNetCore.csproj index 03f14bc7..d1c7ec64 100644 --- a/src/GSS.Authentication.CAS.AspNetCore/GSS.Authentication.CAS.AspNetCore.csproj +++ b/src/GSS.Authentication.CAS.AspNetCore/GSS.Authentication.CAS.AspNetCore.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netcoreapp3.1;net8.0 ASP.NET Core Middlewares for CAS Authentication