zoukankan      html  css  js  c++  java
  • 1.0IAuthenticationHandler



    IAuthenticationHandler
    IAuthenticationRequestHandler : IAuthenticationHandler
    IAuthenticationSignOutHandler : IAuthenticationHandler
    IAuthenticationSignInHandler : IAuthenticationSignOutHandler
    
    

    using
    System.Threading.Tasks; using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.Authentication { /// <summary> /// Created per request to handle authentication for a particular scheme. /// </summary> public interface IAuthenticationHandler { /// <summary> /// Initialize the authentication handler. The handler should initialize anything it needs from the request and scheme as part of this method. /// </summary> /// <param name="scheme">The <see cref="AuthenticationScheme"/> scheme.</param> /// <param name="context">The <see cref="HttpContext"/> context.</param> Task InitializeAsync(AuthenticationScheme scheme, HttpContext context); /// <summary> /// Authenticate the current request. /// </summary> /// <returns>The <see cref="AuthenticateResult"/> result.</returns> Task<AuthenticateResult> AuthenticateAsync(); /// <summary> /// Challenge the current request. /// </summary> /// <param name="properties">The <see cref="AuthenticationProperties"/> that contains the extra meta-data arriving with the authentication.</param> Task ChallengeAsync(AuthenticationProperties? properties); /// <summary> /// Forbid the current request. /// </summary> /// <param name="properties">The <see cref="AuthenticationProperties"/> that contains the extra meta-data arriving with the authentication.</param> Task ForbidAsync(AuthenticationProperties? properties); } }
    using System.Threading.Tasks;
    
    namespace Microsoft.AspNetCore.Authentication
    {
        /// <summary>
        /// Used to determine if a handler wants to participate in request processing.
        /// </summary>
        public interface IAuthenticationRequestHandler : IAuthenticationHandler
        {
            /// <summary>
            /// Gets a value that determines if the request should stop being processed.
            /// <para>
            /// This feature is supported by the Authentication middleware
            /// which does not invoke any subsequent <see cref="IAuthenticationHandler"/> or middleware configured in the request pipeline
            /// if the handler returns <see langword="true" />.
            /// </para>
            /// </summary>
            /// <returns><see langword="true" /> if request processing should stop.</returns>
            Task<bool> HandleRequestAsync();
        }
    
    }
    using System.Threading.Tasks;
    
    namespace Microsoft.AspNetCore.Authentication
    {
        /// <summary>
        /// Used to determine if a handler supports SignOut.
        /// </summary>
        public interface IAuthenticationSignOutHandler : IAuthenticationHandler
        {
            /// <summary>
            /// Signout behavior.
            /// </summary>
            /// <param name="properties">The <see cref="AuthenticationProperties"/> that contains the extra meta-data arriving with the authentication.</param>
            /// <returns>A task.</returns>
            Task SignOutAsync(AuthenticationProperties? properties);
        }
    
    }
    using System.Security.Claims;
    using System.Threading.Tasks;
    
    namespace Microsoft.AspNetCore.Authentication
    {
        /// <summary>
        /// Used to determine if a handler supports SignIn.
        /// </summary>
        public interface IAuthenticationSignInHandler : IAuthenticationSignOutHandler
        {
            /// <summary>
            /// Handle sign in.
            /// </summary>
            /// <param name="user">The <see cref="ClaimsPrincipal"/> user.</param>
            /// <param name="properties">The <see cref="AuthenticationProperties"/> that contains the extra meta-data arriving with the authentication.</param>
            /// <returns>A task.</returns>
            Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
        }
    }
  • 相关阅读:
    制作在线简历(一)——Loading与底部菜单
    然而这并没有什么卵用
    移动开发中Fiddler的那些事儿
    多种方法实现Loading(加载)动画效果
    总结)Nginx/LVS/HAProxy负载均衡软件的优缺点详解
    SQLServer和MySQL job和 event定时器的差别
    全局ID的重要性
    Windows操作系统上各种服务使用的端口号, 以及它们使用的协议的列表
    Linux发展历史图
    奇特的Local System权限(转载)
  • 原文地址:https://www.cnblogs.com/htlp/p/15255704.html
Copyright © 2011-2022 走看看