Beispiel #1
0
        public IAuthenticationConfig Create(FileAuthenticationOptions authenticationOptions)
        {
            if (authenticationOptions.Provider == "Jwt")
            {
                return(CreateJwt(authenticationOptions));
            }

            return(CreateIdentityServer(authenticationOptions));
        }
        private async Task <bool> IsSupportedAuthenticationProviders(FileAuthenticationOptions authenticationOptions, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(authenticationOptions.AuthenticationProviderKey))
            {
                return(true);
            }
            var schemes = await _authenticationSchemeProvider.GetAllSchemesAsync();

            var supportedSchemes = schemes.Select(scheme => scheme.Name).ToList();

            return(supportedSchemes.Contains(authenticationOptions.AuthenticationProviderKey));
        }