src/Module/Authentication/OAuth.php
protected function initProvider($providerConfig)
    {
        $providerClass = $providerConfig['provider'];
        $options = $providerConfig['options'];

        if (!isset($options['redirectUri'])) {
            // Set OAuth 2.0 callback page from the configuration
            $options['redirectUri'] = $this->picoAuth->getPico()->getPageUrl($this->config["callbackPage"]);
        }

        if (!class_exists($providerClass)) {
            throw new \RuntimeException("Provider class $providerClass does not exist.");
        }

        if (!is_subclass_of($providerClass, AbstractProvider::class, true)) {
            throw new \RuntimeException("Class $providerClass is not a League\OAuth2 provider.");
        }

        $this->provider = new $providerClass($options);
        $this->providerConfig = $providerConfig;
    }
protected function initProvider($providerConfig)
    {
        $providerClass = $providerConfig['provider'];
        $options = $providerConfig['options'];

        if (!isset($options['redirectUri'])) {
            // Set OAuth 2.0 callback page from the configuration
            $options['redirectUri'] = $this->picoAuth->getPico()->getPageUrl($this->config["callbackPage"]);
        }

        if (!class_exists($providerClass)) {
            throw new \RuntimeException("Provider class $providerClass does not exist.");
        }

        if (!is_subclass_of($providerClass, AbstractProvider::class, true)) {
            throw new \RuntimeException("Class $providerClass is not a League\OAuth2 provider.");
        }

        $this->provider = new $providerClass($options);
        $this->providerConfig = $providerConfig;
    }
Initializes an instance of the provider from the configuration

@param array $providerConfig Configuration array of the selected provider
@throws \RuntimeException If the provider is not resolvable