Remove unneeded AuthenticateContext

This commit is contained in:
Hao Kung 2017-04-14 17:19:25 -07:00
parent f9e19ed522
commit ef9ff35370
3 changed files with 2 additions and 25 deletions

View File

@ -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
{
/// <summary>
/// Base class used by <see cref="IAuthenticationHandler"/> methods.
/// </summary>
public class AuthenticateContext : BaseAuthenticationContext
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="context">The <see cref="HttpContext"/> context.</param>
/// <param name="authenticationScheme">The name of the authentication scheme.</param>
public AuthenticateContext(HttpContext context, string authenticationScheme) : base(context, authenticationScheme, properties: null)
{ }
}
}

View File

@ -22,9 +22,8 @@ namespace Microsoft.AspNetCore.Authentication
/// <summary> /// <summary>
/// Authentication behavior. /// Authentication behavior.
/// </summary> /// </summary>
/// <param name="context">The <see cref="AuthenticateContext"/> context.</param>
/// <returns>The <see cref="AuthenticateResult"/> result.</returns> /// <returns>The <see cref="AuthenticateResult"/> result.</returns>
Task<AuthenticateResult> AuthenticateAsync(AuthenticateContext context); Task<AuthenticateResult> AuthenticateAsync();
/// <summary> /// <summary>
/// Challenge behavior. /// Challenge behavior.

View File

@ -65,8 +65,7 @@ namespace Microsoft.AspNetCore.Authentication
throw new InvalidOperationException($"No authentication handler is configured to authenticate for the scheme: {scheme}"); 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();
var result = await handler.AuthenticateAsync(authContext);
if (result.Succeeded) if (result.Succeeded)
{ {
var transformed = await Transform.TransformAsync(result.Principal); var transformed = await Transform.TransformAsync(result.Principal);