[Mvc] Adds SignIn and SignOut method overloads without authentication scheme to ControllerBase (#23604)
This commit is contained in:
parent
f0bb1315cc
commit
9d7c3aff96
|
|
@ -541,10 +541,18 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
public virtual Microsoft.AspNetCore.Mvc.RedirectToRouteResult RedirectToRoutePreserveMethod(string routeName = null, object routeValues = null, string fragment = null) { throw null; }
|
public virtual Microsoft.AspNetCore.Mvc.RedirectToRouteResult RedirectToRoutePreserveMethod(string routeName = null, object routeValues = null, string fragment = null) { throw null; }
|
||||||
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
|
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal) { throw null; }
|
||||||
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
|
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { throw null; }
|
||||||
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, string authenticationScheme) { throw null; }
|
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, string authenticationScheme) { throw null; }
|
||||||
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal, string authenticationScheme) { throw null; }
|
public virtual Microsoft.AspNetCore.Mvc.SignInResult SignIn(System.Security.Claims.ClaimsPrincipal principal, string authenticationScheme) { throw null; }
|
||||||
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
|
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut() { throw null; }
|
||||||
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
|
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut(Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { throw null; }
|
||||||
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut(Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, params string[] authenticationSchemes) { throw null; }
|
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut(Microsoft.AspNetCore.Authentication.AuthenticationProperties properties, params string[] authenticationSchemes) { throw null; }
|
||||||
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
[Microsoft.AspNetCore.Mvc.NonActionAttribute]
|
||||||
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut(params string[] authenticationSchemes) { throw null; }
|
public virtual Microsoft.AspNetCore.Mvc.SignOutResult SignOut(params string[] authenticationSchemes) { throw null; }
|
||||||
|
|
@ -1170,6 +1178,8 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
}
|
}
|
||||||
public partial class SignInResult : Microsoft.AspNetCore.Mvc.ActionResult
|
public partial class SignInResult : Microsoft.AspNetCore.Mvc.ActionResult
|
||||||
{
|
{
|
||||||
|
public SignInResult(System.Security.Claims.ClaimsPrincipal principal) { }
|
||||||
|
public SignInResult(System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
||||||
public SignInResult(string authenticationScheme, System.Security.Claims.ClaimsPrincipal principal) { }
|
public SignInResult(string authenticationScheme, System.Security.Claims.ClaimsPrincipal principal) { }
|
||||||
public SignInResult(string authenticationScheme, System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
public SignInResult(string authenticationScheme, System.Security.Claims.ClaimsPrincipal principal, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
||||||
public string AuthenticationScheme { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public string AuthenticationScheme { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
|
|
@ -1181,6 +1191,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
public partial class SignOutResult : Microsoft.AspNetCore.Mvc.ActionResult
|
public partial class SignOutResult : Microsoft.AspNetCore.Mvc.ActionResult
|
||||||
{
|
{
|
||||||
public SignOutResult() { }
|
public SignOutResult() { }
|
||||||
|
public SignOutResult(Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
||||||
public SignOutResult(System.Collections.Generic.IList<string> authenticationSchemes) { }
|
public SignOutResult(System.Collections.Generic.IList<string> authenticationSchemes) { }
|
||||||
public SignOutResult(System.Collections.Generic.IList<string> authenticationSchemes, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
public SignOutResult(System.Collections.Generic.IList<string> authenticationSchemes, Microsoft.AspNetCore.Authentication.AuthenticationProperties properties) { }
|
||||||
public SignOutResult(string authenticationScheme) { }
|
public SignOutResult(string authenticationScheme) { }
|
||||||
|
|
|
||||||
|
|
@ -2386,6 +2386,15 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
public virtual ForbidResult Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)
|
public virtual ForbidResult Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)
|
||||||
=> new ForbidResult(authenticationSchemes, properties);
|
=> new ForbidResult(authenticationSchemes, properties);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="SignInResult"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
||||||
|
/// <returns>The created <see cref="SignInResult"/> for the response.</returns>
|
||||||
|
[NonAction]
|
||||||
|
public virtual SignInResult SignIn(ClaimsPrincipal principal)
|
||||||
|
=> new SignInResult(principal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme.
|
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2396,6 +2405,18 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
public virtual SignInResult SignIn(ClaimsPrincipal principal, string authenticationScheme)
|
public virtual SignInResult SignIn(ClaimsPrincipal principal, string authenticationScheme)
|
||||||
=> new SignInResult(authenticationScheme, principal);
|
=> new SignInResult(authenticationScheme, principal);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="SignInResult"/> with <paramref name="properties"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
||||||
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-in operation.</param>
|
||||||
|
/// <returns>The created <see cref="SignInResult"/> for the response.</returns>
|
||||||
|
[NonAction]
|
||||||
|
public virtual SignInResult SignIn(
|
||||||
|
ClaimsPrincipal principal,
|
||||||
|
AuthenticationProperties properties)
|
||||||
|
=> new SignInResult(principal, properties);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme and
|
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
|
|
@ -2411,6 +2432,23 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
string authenticationScheme)
|
string authenticationScheme)
|
||||||
=> new SignInResult(authenticationScheme, principal, properties);
|
=> new SignInResult(authenticationScheme, principal, properties);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="SignOutResult"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The created <see cref="SignOutResult"/> for the response.</returns>
|
||||||
|
[NonAction]
|
||||||
|
public virtual SignOutResult SignOut()
|
||||||
|
=> new SignOutResult();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="SignOutResult"/> with <paramref name="properties"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
||||||
|
/// <returns>The created <see cref="SignOutResult"/> for the response.</returns>
|
||||||
|
[NonAction]
|
||||||
|
public virtual SignOutResult SignOut(AuthenticationProperties properties)
|
||||||
|
=> new SignOutResult(properties);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignOutResult"/> with the specified authentication schemes.
|
/// Creates a <see cref="SignOutResult"/> with the specified authentication schemes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,16 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SignInResult : ActionResult
|
public class SignInResult : ActionResult
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
||||||
|
/// default authentication scheme.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="principal">The claims principal containing the user claims.</param>
|
||||||
|
public SignInResult(ClaimsPrincipal principal)
|
||||||
|
: this(authenticationScheme: null, principal, properties: null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
||||||
/// specified authentication scheme.
|
/// specified authentication scheme.
|
||||||
|
|
@ -27,6 +37,17 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
||||||
|
/// default authentication scheme and <paramref name="properties"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="principal">The claims principal containing the user claims.</param>
|
||||||
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-in operation.</param>
|
||||||
|
public SignInResult(ClaimsPrincipal principal, AuthenticationProperties properties)
|
||||||
|
: this(authenticationScheme: null, principal, properties)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
/// Initializes a new instance of <see cref="SignInResult"/> with the
|
||||||
/// specified authentication scheme and <paramref name="properties"/>.
|
/// specified authentication scheme and <paramref name="properties"/>.
|
||||||
|
|
@ -36,8 +57,8 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-in operation.</param>
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-in operation.</param>
|
||||||
public SignInResult(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties)
|
public SignInResult(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties)
|
||||||
{
|
{
|
||||||
AuthenticationScheme = authenticationScheme ?? throw new ArgumentNullException(nameof(authenticationScheme));
|
|
||||||
Principal = principal ?? throw new ArgumentNullException(nameof(principal));
|
Principal = principal ?? throw new ArgumentNullException(nameof(principal));
|
||||||
|
AuthenticationScheme = authenticationScheme;
|
||||||
Properties = properties;
|
Properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,16 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of <see cref="SignOutResult"/> with the default sign out scheme.
|
||||||
|
/// specified authentication scheme and <paramref name="properties"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
||||||
|
public SignOutResult(AuthenticationProperties properties)
|
||||||
|
: this(Array.Empty<string>(), properties)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of <see cref="SignOutResult"/> with the
|
/// Initializes a new instance of <see cref="SignOutResult"/> with the
|
||||||
/// specified authentication scheme.
|
/// specified authentication scheme.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue