Remove unneeded AuthenticateContext
This commit is contained in:
parent
f9e19ed522
commit
ef9ff35370
|
|
@ -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)
|
|
||||||
{ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue