class Users \ OAuth2Providers


Provides an interface to supported OAuth2 providers. We need to provide a wrapper around this so we can map our oauth2 provider key (e.g. 'google' to the relevant ProviderInterface for OAuth2.) TODO this could be abstracted out into component-discovery for each provider


Method Summary

Name Description
__construct($key, ProviderInterface $provider)
createProvider($key, $redirect) Allows instances to be created based on #getProviders().
facebook($redirect) Get the OAuth2Providers for the Facebook authentication handler.
getKey()
getProvider()
getProviders() Get a list of all the provider keys supported by this component.
github($redirect) Get the OAuth2Providers for the Github authentication handler.
google($redirect) Get the OAuth2Providers for the Google authentication handler.
loadProvider($key, $redirect) Load the ProviderInterface with the given key, from #getProviders().

public function __construct($key, ProviderInterface $provider)


static function createProvider($key, $redirect)

Allows instances to be created based on #getProviders().


static function facebook($redirect)

Get the OAuth2Providers for the Facebook authentication handler.

Parameters:
$redirect - the redirectUri to provide the provider.
Returns:
A OAuth2Providers

public function getKey()


public function getProvider()


static function getProviders()

Get a list of all the provider keys supported by this component.

See:
createProvider($key, $redirect)

static function github($redirect)

Get the OAuth2Providers for the Github authentication handler.

Parameters:
$redirect - the redirectUri to provide the provider.
Returns:
A OAuth2Providers

static function google($redirect)

Get the OAuth2Providers for the Google authentication handler.

Parameters:
$redirect - the redirectUri to provide the provider.
Returns:
A OAuth2Providers

static function loadProvider($key, $redirect)

Load the ProviderInterface with the given key, from #getProviders().

Parameters:
$redirect - the redirectUri to provide the provider.
Returns:
A ProviderInterface