public override async Task<AuthenticationResult> AuthenticateAsync([NotNull] string authenticationScheme) { var handler = HttpAuthenticationFeature.Handler; var authenticateContext = new AuthenticateContext(authenticationScheme); if (handler != null) { await handler.AuthenticateAsync(authenticateContext); } // Verify all types ack'd if (!authenticateContext.Accepted) { throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme); } return authenticateContext.Result; }
public override AuthenticationResult Authenticate([NotNull] string authenticationScheme) { var handler = HttpAuthenticationFeature.Handler; var authenticateContext = new AuthenticateContext(authenticationScheme); if (handler != null) { handler.Authenticate(authenticateContext); } if (!authenticateContext.Accepted) { throw new InvalidOperationException("The following authentication scheme was not accepted: " + authenticationScheme); } return authenticateContext.Result; }