Свойство | Тип | Описание | |
---|---|---|---|
$clientId | OAuth client ID. | ||
$clientSecret | OAuth client secret. | ||
$tokenUrl | token request URL endpoint. | ||
$validateAuthState | whether to use and validate auth 'state' parameter in authentication flow. If enabled - the opaque value will be generated and applied to auth URL to maintain state between the request and callback. The authorization server includes this value, when redirecting the user-agent back to the client. The option is used for preventing cross-site request forgery. | ||
$version | protocol version. |
Метод | Описание | |
---|---|---|
applyAccessTokenToRequest ( $request, $accessToken ) | ||
authenticateClient ( array $params = [] ) : |
Authenticate OAuth client directly at the provider without third party (user) involved, using 'client_credentials' grant type. | |
authenticateUser ( string $username, string $password, array $params = [] ) : |
Authenticates user directly by 'username/password' pair, using 'password' grant type. | |
buildAuthUrl ( array $params = [] ) : string | Composes user authorization URL. | |
fetchAccessToken ( string $authCode, array $params = [] ) : |
Fetches access token from authorization code. | |
refreshAccessToken ( |
Gets new auth token to replace expired one. |
Метод | Описание | |
---|---|---|
createToken ( array $tokenConfig = [] ) : |
Creates token from its configuration. | |
defaultReturnUrl ( ) : string | Composes default [[returnUrl]] value. | |
generateAuthState ( ) : string | Generates the auth state value. |
public applyAccessTokenToRequest ( $request, $accessToken ) |
public authenticateClient ( array $params = [] ) : |
||
$params | array | additional request params. |
Результат | access token. |
public buildAuthUrl ( array $params = [] ) : string | ||
$params | array | additional auth GET params. |
Результат | string | authorization URL. |
protected createToken ( array $tokenConfig = [] ) : |
||
$tokenConfig | array | token configuration. |
Результат | token instance. |
protected defaultReturnUrl ( ) : string | ||
Результат | string | return URL. |
public fetchAccessToken ( string $authCode, array $params = [] ) : |
||
$authCode | string | authorization code, usually comes at $_GET['code']. |
$params | array | additional request params. |
Результат | access token. |
protected generateAuthState ( ) : string | ||
Результат | string | auth state value. |
public refreshAccessToken ( |
||
$token | expired auth token. | |
Результат | new auth token. |
public $validateAuthState |