Commit 124f4fa9 by Paul Klimov

Doc comments in "authclient" extension updated.

parent bb37b7b5
......@@ -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
......
......@@ -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
* ~~~
......
......@@ -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 = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment