Context object used to control flow of Basic authentication.
Inheritance: BaseBasicContext
        /// <summary>
        /// Handles the authentication by checking the "Authorization" header.
        /// </summary>
        protected override async Task <AuthenticateResult> HandleAuthenticateAsync()
        {
            AuthenticationTicket ticket = null;

            try
            {
                var header = Request.Headers["Authorization"];

                if (IsBasicAuthentication(header))
                {
                    var credentials = DecodeCredentials(header);

                    var context = new BasicSignInContext(Context, Options, credentials.UserName,
                                                         credentials.Password);

                    await Options.Events.SignInAsync(context).ConfigureAwait(false);

                    if (context.Principal != null)
                    {
                        ticket = new AuthenticationTicket(context.Principal, new AuthenticationProperties(),
                                                          Options.AuthenticationScheme);
                    }
                }

                return(AuthenticateResult.Success(ticket));
            }
            catch (Exception ex)
            {
                return(AuthenticateResult.Fail(ex));
            }
        }
 /// <summary>
 /// Implements the interface method by invoking the related delegate method.
 /// </summary>
 /// <param name="context">Contains information about the event.</param>
 public virtual Task SignInAsync(BasicSignInContext context)
 => OnSignIn(context);
 /// <summary>
 /// Implements the interface method by invoking the related delegate method.
 /// </summary>
 /// <param name="context">Contains information about the event.</param>
 public virtual Task SignInAsync(BasicSignInContext context)
     => OnSignIn(context);