Browse Source

Doc comments in "authclient" extension updated.

tags/2.0.0-beta
Paul Klimov 11 years ago
parent
commit
124f4fa9f7
  1. 2
      extensions/yii/authclient/ClientInterface.php
  2. 2
      extensions/yii/authclient/OAuth1.php
  3. 32
      extensions/yii/authclient/OpenId.php

2
extensions/yii/authclient/ClientInterface.php

@ -8,7 +8,7 @@
namespace yii\authclient;
/**
* Class ProviderInterface
* ClientInterface declares basic interface all Auth clients should follow.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0

2
extensions/yii/authclient/OAuth1.php

@ -21,7 +21,7 @@ use Yii;
* $oauthClient = new OAuth1();
* $requestToken = $oauthClient->fetchRequestToken(); // Get request token
* $url = $oauthClient->buildAuthUrl($requestToken); // Get authorization URL
* Yii::$app->getResponse()->redirect($url); // Redirect to authorization URL
* return Yii::$app->getResponse()->redirect($url); // Redirect to authorization URL
* // After user returns at our site:
* $accessToken = $oauthClient->fetchAccessToken($requestToken); // Upgrade to access token
* ~~~

32
extensions/yii/authclient/OpenId.php

@ -12,7 +12,27 @@ use yii\base\NotSupportedException;
use Yii;
/**
* Class Client
* OpenId provides a simple interface for OpenID (1.1 and 2.0) authentication.
* Supports Yadis and HTML discovery.
*
* Usage:
*
* ~~~
* use yii\authclient\OpenId;
*
* $client = new OpenId();
* $client->authUrl = 'https://open.id.provider.url'; // Setup provider endpoint
* $url = $client->buildAuthUrl(); // Get authentication URL
* return Yii::$app->getResponse()->redirect($url); // Redirect to authentication URL
* // After user returns at our site:
* if ($client->validate()) { // validate response
* $userAttributes = $client->getUserAttributes(); // get account info
* ...
* }
* ~~~
*
* AX and SREG extensions are supported.
* To use them, specify [[requiredAttributes]] and/or [[optionalAttributes]].
*
* @see http://openid.net/
*
@ -32,10 +52,20 @@ class OpenId extends BaseClient implements ClientInterface
public $authUrl;
/**
* @var array 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 $requiredAttributes = [];
/**
* @var array list of attributes, which could be returned from server.
* Attribute names should be always specified in AX format.
* For example:
* ~~~
* ['namePerson/first', 'namePerson/last']
* ~~~
*/
public $optionalAttributes = [];

Loading…
Cancel
Save