From ef9ff35370433c5ce2488037c7f99611a09da364 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 14 Apr 2017 17:19:25 -0700 Subject: [PATCH] Remove unneeded AuthenticateContext --- .../AuthenticateContext.cs | 21 ------------------- .../IAuthenticationHandler.cs | 3 +-- .../AuthenticationService.cs | 3 +-- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticateContext.cs diff --git a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticateContext.cs b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticateContext.cs deleted file mode 100644 index 814d7024e4..0000000000 --- a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticateContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Authentication -{ - /// - /// Base class used by methods. - /// - public class AuthenticateContext : BaseAuthenticationContext - { - /// - /// Constructor. - /// - /// The context. - /// The name of the authentication scheme. - public AuthenticateContext(HttpContext context, string authenticationScheme) : base(context, authenticationScheme, properties: null) - { } - } -} diff --git a/src/Microsoft.AspNetCore.Authentication.Abstractions/IAuthenticationHandler.cs b/src/Microsoft.AspNetCore.Authentication.Abstractions/IAuthenticationHandler.cs index 7a805f7af4..49d5f498af 100644 --- a/src/Microsoft.AspNetCore.Authentication.Abstractions/IAuthenticationHandler.cs +++ b/src/Microsoft.AspNetCore.Authentication.Abstractions/IAuthenticationHandler.cs @@ -22,9 +22,8 @@ namespace Microsoft.AspNetCore.Authentication /// /// Authentication behavior. /// - /// The context. /// The result. - Task AuthenticateAsync(AuthenticateContext context); + Task AuthenticateAsync(); /// /// Challenge behavior. diff --git a/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs b/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs index 9b8837f22e..9196e62cf6 100644 --- a/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs +++ b/src/Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs @@ -65,8 +65,7 @@ namespace Microsoft.AspNetCore.Authentication throw new InvalidOperationException($"No authentication handler is configured to authenticate for the scheme: {scheme}"); } - var authContext = new AuthenticateContext(context, scheme); - var result = await handler.AuthenticateAsync(authContext); + var result = await handler.AuthenticateAsync(); if (result.Succeeded) { var transformed = await Transform.TransformAsync(result.Principal);