Exemple #1
0
        private async Task <AuthenticateResult> ReportNonSuccessAndReturn(string error)
        {
            var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme, Options)
            {
                Error = error
            };

            await Events.AuthenticationFailed(authenticationFailedContext);

            if (authenticationFailedContext.Result != null)
            {
                return(authenticationFailedContext.Result);
            }

            return(AuthenticateResult.Fail(error));
        }
        private static async Task <AuthenticateResult> ReportNonSuccessAndReturn(
            string error,
            HttpContext httpContext,
            AuthenticationScheme scheme,
            OAuth2IntrospectionEvents events,
            OAuth2IntrospectionOptions options)
        {
            var authenticationFailedContext = new AuthenticationFailedContext(httpContext, scheme, options)
            {
                Error = error
            };

            await events.AuthenticationFailed(authenticationFailedContext);

            if (authenticationFailedContext.Result != null)
            {
                return(authenticationFailedContext.Result);
            }

            return(AuthenticateResult.Fail(error));
        }
 /// <summary>
 /// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed.
 /// </summary>
 public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context);