@deprecated this method will be removed in BjyAuthorize 2.0.x

@param ResourceProvider $provider

@return self
3876
public function addResourceProvider(ResourceProvider $provider)
    {
        $this->loaded && $this->loaded->__invoke();

        $this->resourceProviders[] = $provider;

        return $this;
    }
927709
public function loginAndRegisterVia($provider)
    {
        $this->authenticationService = $this->authenticationServiceFactory->getInstance($provider);

        $isUserLoggedIn = $this->accountService->checkUser();

        // active sw login session
        if ($isUserLoggedIn) {
            return $isUserLoggedIn;
        }

        if ($this->authenticationService !== null) {
            // sso login
            $isAuthenticated = $this->authenticationService->login();
            $customer = null;
            if ($isAuthenticated) {
                // get user data from sso provider
                $user = $this->authenticationService->getUser();
                if ($user !== null && $user->getEmail() !== '') {
                    // get sw customer
                    $customer = $this->customerService->getCustomerByIdentity($provider, $user->getId());
                    if ($customer !== null) {
                        // new login
                        $isUserLoggedIn = $this->tryLoginCustomer($customer);
                    } else {
                        $customer = $this->customerService->getCustomerByEmail($user->getEmail());
                        if ($customer !== null) {
                            // connect
                            $customer = $this->registerService->connectUserWithExistingCustomer($user, $customer);
                        } else {
                            // register
                            $customer = $this->registerService->registerCustomerByUser($user);
                        }
                        $isUserLoggedIn = $this->tryLoginCustomer($customer);
                    }
                }
            } else {
                $isUserLoggedIn = false;
            }

            $this->container->get('events')->notify(
                'Port1HybridAuth_Service_SingleSignOn_CustomerLoggedIn',
                [
                    'customer' => $customer,
                    'isUserLoggedIn' => $isUserLoggedIn
                ]
            );
        }
        return $isUserLoggedIn;
    }
318223
protected function validateProvider($provider) {
        if (is_string($provider)) {
            if ( ! class_exists($provider)) {
                $message = s('Provider class %s does not exist.', $provider);

                throw new InvalidProviderException($message);
            }
        } else if ( ! is_object($provider)) {
            $message = s(
                'Provider must be either a valid class name, or an instance, received: "%s".',
                get_type($provider)
            );

            throw new InvalidProviderException($message);
        }
    }
1170017
public function toProvider(string $provider)
    {
        if (! class_exists($provider)) {
            throw new NotFound($provider);
        }
        if (! (new \ReflectionClass($provider))->implementsInterface(ProviderInterface::class)) {
            throw new InvalidProvider($provider);
        }
    }
1256764
public function callback($provider = null)
    {
        $this->login->loginUser($provider);

        return redirect()
            ->intended(route('home'))
            ->with('message', 'You have been logged in.');
    }
488161
public function register($provider)
    {
        if (! $provider instanceof ServiceProvider) {
            $provider = new $provider($this);
        }

        if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
            return;
        }

        $this->loadedProviders[$providerName] = true;

        if (method_exists($provider, 'register')) {
            $provider->register();
        }

        if (method_exists($provider, 'boot')) {
            return $this->call([$provider, 'boot']);
        }
    }
1252755
public function handle(ConfigurationProvider $provider)
    {
        $this->configuration = $provider->getForConnection(
            $this->option('connection')
        );

        if (!$this->option('add') && !$this->option('delete')) {
            return $this->error('You must specify whether you want to --add or --delete the specified version.');
        }

        $this->markMigrated = (boolean) $this->option('add');

        if ($this->input->isInteractive()) {
            $question = 'WARNING! You are about to add, delete or synchronize migration versions from the version table that could result in data lost. Are you sure you wish to continue? (y/n)';
            if ($this->confirm($question)) {
                $this->markVersions();
            } else {
                $this->error('Migration cancelled!');
            }
        } else {
            $this->markVersions();
        }
    }
622590
public static function create($oAuthProvider)
    {
        if (strpos($oAuthProvider, '\\') !== false) {
            if (class_exists($oAuthProvider)) {
                $providerInstance = new $oAuthProvider();
                if (!($providerInstance instanceof AbstractOAuthProvider)) {
                    throw new Exception(
                        sprintf(
                            'OAuth provider "%s" must be extend "AbstractOAuthProvider".',
                            $oAuthProvider
                        )
                    );
                }

                return $providerInstance;
            } else {
                throw new Exception(sprintf('OAuth provider "%s" does not exist.', $oAuthProvider));
            }
        }

        $oAuthClass = 'Rad\\OAuthentication\\Provider\\' .
            Inflection::camelize($oAuthProvider) . 'Provider';

        if (class_exists($oAuthClass)) {
            return new $oAuthClass();
        } else {
            throw new Exception(sprintf('OAuth provider "%s" does not exist.', $oAuthClass));
        }
    }
441750
public function setProvider(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Provider $provider = null)
    {
        $this->provider = $provider;

        return $this;
    }
992341
public function addRoleProvider(RoleProvider $provider)
    {
        $this->loaded && $this->loaded->__invoke();

        $this->roleProviders[] = $provider;

        return $this;
    }
892064
public function authCredentials(string $username, string $password): self
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
216585
public function register($provider, $options = array())
	{
		$provider->register($this);

		foreach ($options as $key => $value)
		{
			$this[$key] = $value;
		}

		return $this;
	}
362080
public function registerProvider(DataTablesProviderInterface $provider) {
        if (true === $this->exists($provider->getName())) {
            throw new AlreadyRegisteredDataTablesProviderException($provider->getName());
        }
        $this->index[$provider->getName()] = $this->size();
        return $this->addProvider($provider);
    }
701662
public function addProvider($provider)
    {
        if (is_string($provider)) {
            $provider = new $provider($this);
        }

        // Only allow a service provider to be registered
        // once.
        if (in_array($provider, $this->providers)) {
            return;
        }

        $this->providers[] = $provider;

        $this->registerEvents($provider);
        $this->registerProvides($provider);

        $this->registerProvider($provider);
    }
4542
protected function setProvider($name, ThemeProviderInterface $provider) {
        $k = ObjectHelper::getShortName($name);
        $v = $this->getIndex()[$k];
        if (null !== $v) {
            $this->getProviders()[$v] = $provider;
            return $this;
        }
        $this->index[$k] = count($this->getProviders());
        return $this->addProvider($provider);
    }
2089
private function resolveProviderAnnotation($provider)
    {
        if (is_array($provider)) {

            foreach ($provider as $item) {
                $this->resolveProviderAnnotation($item);
            }

        } else {
            if (false === $this->isProvided($provider)) {
                $this->addProvider($provider);
            }
        }
    }
21588
public static function create(ProviderInterface $provider, array $config)
    {
        return OAuth1Factory::create(
            array_merge($provider->getUriConfig(), $config),
            $provider->getSigner()
        );
    }