zoukankan      html  css  js  c++  java
  • 2.1SignOutAuthenticationHandler【AuthenticationHandler、IAuthenticationSignOutHandler】

    using System.Text.Encodings.Web;
    using System.Threading.Tasks;
    using Microsoft.Extensions.Logging;
    using Microsoft.Extensions.Options;
    
    namespace Microsoft.AspNetCore.Authentication
    {
        /// <summary>
        /// Adds support for SignOutAsync
        /// </summary>
        public abstract class SignOutAuthenticationHandler<TOptions> : AuthenticationHandler<TOptions>, IAuthenticationSignOutHandler
            where TOptions : AuthenticationSchemeOptions, new()
        {
            /// <summary>
            /// Initializes a new instance of <see cref="SignOutAuthenticationHandler{TOptions}"/>.
            /// </summary>
            /// <param name="options">The monitor for the options instance.</param>
            /// <param name="logger">The <see cref="ILoggerFactory"/>.</param>
            /// <param name="encoder">The <see cref="UrlEncoder"/>.</param>
            /// <param name="clock">The <see cref="ISystemClock"/>.</param>
            public SignOutAuthenticationHandler(IOptionsMonitor<TOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
            { }
    
            /// <inheritdoc/>
            public virtual Task SignOutAsync(AuthenticationProperties? properties)
            {
                var target = ResolveTarget(Options.ForwardSignOut);
                return (target != null)
                    ? Context.SignOutAsync(target, properties)
                    : HandleSignOutAsync(properties ?? new AuthenticationProperties());
            }
    
            /// <summary>
            /// Override this method to handle SignOut.
            /// </summary>
            /// <param name="properties"></param>
            protected abstract Task HandleSignOutAsync(AuthenticationProperties? properties);
        }
    }
  • 相关阅读:
    JS—ajax及async和defer的区别
    js-cookie和session
    h5小功能_classList和自定义属性data
    html5-attr和prop
    人工智能与金融
    IBM的人工智能“沃森”首次确诊罕见白血病,只用了10分钟!
    终极复制 人工智能将如何推动社会巨变
    对人工智能问题的提问
    人工智能预测精神病
    人工智能代替工人
  • 原文地址:https://www.cnblogs.com/htlp/p/15256489.html
Copyright © 2011-2022 走看看