Class yii\authclient\clients\GoogleHybrid
| Inheritance | yii\authclient\clients\GoogleHybrid » yii\authclient\clients\Google » yii\authclient\OAuth2 » yii\authclient\BaseOAuth » yii\authclient\BaseClient » yii\base\Component » yii\base\BaseObject |
|---|---|
| Implements | yii\authclient\ClientInterface, yii\base\Configurable |
| Available since version | 2.0.4 |
| Source Code | https://github.com/yiisoft/yii2-authclient/blob/master/clients/GoogleHybrid.php |
GoogleHybrid is an enhanced version of the yii\authclient\clients\Google, which uses Google+ hybrid sign-in flow, which relies on embedded JavaScript code to generate a sign-in button and handle user authentication dialog.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'google' => [
'class' => 'yii\authclient\clients\GoogleHybrid',
'clientId' => 'google_client_id',
'clientSecret' => 'google_client_secret',
],
],
]
// ...
]
Note: Google+ hybrid relies heavily on client-side JavaScript during authorization process, do not attempt to obtain authorization code using buildAuthUrl() unless you absolutely sure, what you are doing.
JavaScript button itself generated by \yii\authclient\clients\yii\authclient\widgets\GooglePlusButton widget. If you are using \yii\authclient\clients\yii\authclient\widgets\AuthChoice it will appear automatically. Otherwise you need to add it into your page manually. You may customize its appearance using 'widget' key at \yii\authclient\clients\viewOptions:
'google' => [
// ...
'viewOptions' => [
'widget' => [
'class' => 'yii\authclient\widgets\GooglePlusButton',
'buttonHtmlOptions' => [
'data-approvalprompt' => 'force'
],
],
],
],
See also:
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $apiBaseUrl | {@inheritdoc} | yii\authclient\clients\Google | |
| $authUrl | {@inheritdoc} | yii\authclient\clients\Google | |
| $autoRefreshAccessToken | boolean | Whether to automatically perform 'refresh access token' request on expired access token. | yii\authclient\BaseOAuth |
| $clientId | string | OAuth client ID. | yii\authclient\OAuth2 |
| $clientSecret | string | OAuth client secret. | yii\authclient\OAuth2 |
| $parametersToKeepInReturnUrl | array | List of the parameters to keep in default return url. | yii\authclient\BaseOAuth |
| $scope | string | Auth request scope. | yii\authclient\BaseOAuth |
| $tokenUrl | {@inheritdoc} | yii\authclient\clients\Google | |
| $validateAuthState | {@inheritdoc} | yii\authclient\clients\GoogleHybrid | |
| $version | string | Protocol version. | yii\authclient\BaseOAuth |
Public Methods
Protected Methods
Property Details
Method Details
{@inheritdoc}
| protected void defaultReturnUrl ( ) |
{@inheritdoc}
| protected void defaultViewOptions ( ) |