Exemple #1
0
        private async Task <Exception> CreateMissingHandlerException(string scheme)
        {
            var schemes = string.Join(", ", (await Schemes.GetAllSchemeAsync()).Select(sch => sch.Name));

            var footer = $" Did you forget to call AddAuthentication().Add[SomeAuthHandler](\"{scheme}\",...)?";

            if (string.IsNullOrEmpty(schemes))
            {
                return(new InvalidOperationException(
                           $"No authentication handlers are registered." + footer));
            }

            return(new InvalidOperationException(
                       $"No authentication handler is registered for the scheme '{scheme}'. The registered schemes are: {schemes}." + footer));
        }
Exemple #2
0
 private async Task <string> GetAllSignOutSchemeNames()
 {
     return(string.Join(", ", (await Schemes.GetAllSchemeAsync())
                        .Where(sch => typeof(IAuthenticationSignOutHandler).IsAssignableFrom(sch.HandlerType))
                        .Select(sch => sch.Name)));
 }