Example #1
0
        protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
        {
            var authenticationChallengedContext = new CertificateChallengeContext(Context, Scheme, Options, properties);
            await Events.Challenge(authenticationChallengedContext);

            if (authenticationChallengedContext.Handled)
            {
                return;
            }

            // Certificate authentication takes place at the connection level. We can't prompt once we're in
            // user code, so the best thing to do is Forbid, not Challenge.
            await HandleForbiddenAsync(properties);
        }
Example #2
0
 /// <summary>
 /// Invoked before a challenge is sent back to the caller.
 /// </summary>
 public virtual Task Challenge(CertificateChallengeContext context) => OnChallenge(context);