Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
124f4fa9
Commit
124f4fa9
authored
Dec 25, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc comments in "authclient" extension updated.
parent
bb37b7b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
ClientInterface.php
extensions/yii/authclient/ClientInterface.php
+1
-1
OAuth1.php
extensions/yii/authclient/OAuth1.php
+1
-1
OpenId.php
extensions/yii/authclient/OpenId.php
+31
-1
No files found.
extensions/yii/authclient/ClientInterface.php
View file @
124f4fa9
...
...
@@ -8,7 +8,7 @@
namespace
yii\authclient
;
/**
* Cl
ass ProviderInterface
* Cl
ientInterface declares basic interface all Auth clients should follow.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
...
...
extensions/yii/authclient/OAuth1.php
View file @
124f4fa9
...
...
@@ -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
* ~~~
...
...
extensions/yii/authclient/OpenId.php
View file @
124f4fa9
...
...
@@ -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
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment