/// <summary> /// Method used when using custom config section /// </summary> private static IAuthenticationProvider DiscoverProvider(IList <Type> discoveredProviders, ProviderKey providerKey) { providerKey.ThrowIfNull("providerKey"); var name = providerKey.Name.ToLowerInvariant(); return(DiscoverProvider(discoveredProviders, name, () => new ProviderParams { PublicApiKey = providerKey.Key, SecretApiKey = providerKey.Secret, Scopes = providerKey.Scope.ScopesToCollection() })); }