Class yii\authclient\clients\YandexOpenId

Inheritanceyii\authclient\clients\YandexOpenId » yii\authclient\OpenId » yii\authclient\BaseClient » yii\base\Component
Implementsyii\authclient\ClientInterface
Available since version2.0

YandexOpenId allows authentication via Yandex OpenId.

Unlike Yandex OAuth you do not need to register your application anywhere in order to use Yandex OpenId.

Example application configuration:

'components' => [
    'authClientCollection' => [
        'class' => 'yii\authclient\Collection',
        'clients' => [
            'yandex' => [
                'class' => 'yii\authclient\clients\YandexOpenId'
            ],
        ],
    ]
    ...
]

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$authUrl string Authentication base URL, which should be used to compose actual authentication URL by buildAuthUrl() method. yii\authclient\clients\YandexOpenId
$axToSregMap array Map of matches between AX and SREG attribute names in format: axAttributeName => sregAttributeName yii\authclient\OpenId
$cainfo string The name of a file holding one or more certificates to verify the peer with. yii\authclient\OpenId
$capath string Directory that holds multiple CA certificates. yii\authclient\OpenId
$data array Data, which should be used to retrieve the OpenID response. yii\authclient\OpenId
$optionalAttributes array List of attributes, which could be returned from server. yii\authclient\OpenId
$requiredAttributes array List of attributes, which always should be returned from server. yii\authclient\clients\YandexOpenId
$verifyPeer boolean Whether to verify the peer's certificate. yii\authclient\OpenId

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
buildAuthUrlV1() Builds authentication URL for the protocol version 1. yii\authclient\OpenId
buildAuthUrlV2() Builds authentication URL for the protocol version 2. yii\authclient\OpenId
buildAxParams() Composes AX request parameters. yii\authclient\OpenId
buildSregParams() Composes SREG request parameters. yii\authclient\OpenId
buildUrl() Combines given URLs into single one. yii\authclient\OpenId
compareUrl() Compares 2 URLs taking in account possible GET parameters order miss match and URL encoding inconsistencies. yii\authclient\OpenId
defaultName() Generates service name. yii\authclient\clients\YandexOpenId
defaultNormalizeUserAttributeMap() Returns the default \yii\authclient\clients\normalizeUserAttributeMap value. yii\authclient\clients\YandexOpenId
defaultReturnUrl() Generates default \yii\authclient\returnUrl value. yii\authclient\OpenId
defaultTitle() Generates service title. yii\authclient\clients\YandexOpenId
defaultViewOptions() Returns the default \yii\authclient\clients\viewOptions value. yii\authclient\clients\YandexOpenId
extractHtmlTagValue() Scans content for / tags and extract information from them. yii\authclient\OpenId
fetchAxAttributes() Gets AX attributes provided by OP. yii\authclient\OpenId
fetchSregAttributes() Gets SREG attributes provided by OP. SREG names will be mapped to AX names. yii\authclient\OpenId
initUserAttributes() Initializes authenticated user attributes. yii\authclient\OpenId
normalizeUserAttributes() Normalize given user attributes according to \yii\authclient\normalizeUserAttributeMap. yii\authclient\BaseClient
sendRequest() Sends request to the server yii\authclient\OpenId
validateRequiredAttributes() Checks if all required attributes are present in the server response. yii\authclient\OpenId

Property Details

$authUrl public property

Authentication base URL, which should be used to compose actual authentication URL by buildAuthUrl() method.

public string $authUrl 'http://openid.yandex.ru'
$requiredAttributes public property

List of attributes, which always should be returned from server. Attribute names should be always specified in AX format. For example:

['namePerson/friendly', 'contact/email']
public array $requiredAttributes = ['namePerson''contact/email']

Method Details

defaultName() protected method

Generates service name.

protected string defaultName ( )
return string

Service name.

defaultNormalizeUserAttributeMap() protected method

Returns the default \yii\authclient\clients\normalizeUserAttributeMap value.

Particular client may override this method in order to provide specific default map.

protected array defaultNormalizeUserAttributeMap ( )
return array

Normalize attribute map.

defaultTitle() protected method

Generates service title.

protected string defaultTitle ( )
return string

Service title.

defaultViewOptions() protected method

Returns the default \yii\authclient\clients\viewOptions value.

Particular client may override this method in order to provide specific default view options.

protected array defaultViewOptions ( )
return array

List of default \yii\authclient\clients\viewOptions