diff --git a/src/Microsoft.AspNetCore.Http.Abstractions/Authentication/AuthenticationManager.cs b/src/Microsoft.AspNetCore.Http.Abstractions/Authentication/AuthenticationManager.cs index 56d9dbad..b2916522 100644 --- a/src/Microsoft.AspNetCore.Http.Abstractions/Authentication/AuthenticationManager.cs +++ b/src/Microsoft.AspNetCore.Http.Abstractions/Authentication/AuthenticationManager.cs @@ -9,6 +9,7 @@ namespace Microsoft.AspNetCore.Http.Authentication { + [Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")] public abstract class AuthenticationManager { /// diff --git a/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs b/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs index a6cc320b..9f4121f4 100644 --- a/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs +++ b/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs @@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Http.Authentication.Internal { + [Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")] public class DefaultAuthenticationManager : AuthenticationManager { // Lambda hoisted to static readonly field to improve inlining https://github.com/dotnet/roslyn/issues/13624 diff --git a/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs b/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs index cdd12630..d02ad632 100644 --- a/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs +++ b/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs @@ -28,7 +28,11 @@ public class DefaultHttpContext : HttpContext private HttpRequest _request; private HttpResponse _response; + +#pragma warning disable CS0618 // Type or member is obsolete private AuthenticationManager _authenticationManager; +#pragma warning restore CS0618 // Type or member is obsolete + private ConnectionInfo _connection; private WebSocketManager _websockets; @@ -66,7 +70,9 @@ public virtual void Uninitialize() } if (_authenticationManager != null) { +#pragma warning disable CS0618 // Type or member is obsolete UninitializeAuthenticationManager(_authenticationManager); +#pragma warning restore CS0618 // Type or member is obsolete _authenticationManager = null; } if (_connection != null) @@ -196,7 +202,9 @@ protected virtual void UninitializeHttpResponse(HttpResponse instance) { } protected virtual ConnectionInfo InitializeConnectionInfo() => new DefaultConnectionInfo(Features); protected virtual void UninitializeConnectionInfo(ConnectionInfo instance) { } + [Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")] protected virtual AuthenticationManager InitializeAuthenticationManager() => new DefaultAuthenticationManager(this); + [Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")] protected virtual void UninitializeAuthenticationManager(AuthenticationManager instance) { } protected virtual WebSocketManager InitializeWebSocketManager() => new DefaultWebSocketManager(Features);