class OAuthClient

This class provides a factory method for creating an OAuth client instance based on the provider name, protocol, and version of this protocol.

If the provider is not a buit-in provider, protocol and version are required.

It also provides a static function to find the last resource owner who logged in.

Methods

static 
create(string $provider, string $protocol = null, string $version = null)

Creates a OAuth client instance according to the given parameters.

static ResourceOwner|null
getConnectedResourceOwner()

Returns the last connected resource owner if there is one.

Details

at line 28
static create(string $provider, string $protocol = null, string $version = null)

Creates a OAuth client instance according to the given parameters.

Parameters

string $provider the provider's name
string $protocol protocol name among 'oauth' or 'openid'
string $version protocol version among '1.0', '1.0a' or '2.0'

Exceptions

OAuthClientException if an error occurs

at line 87
static ResourceOwner|null getConnectedResourceOwner()

Returns the last connected resource owner if there is one.

Return Value

ResourceOwner|null