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
8a3fe891
Commit
8a3fe891
authored
Apr 06, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed "auth" to "authenticator". [skip ci]
parent
83da0cd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
rest.md
docs/guide/rest.md
+4
-4
Controller.php
framework/rest/Controller.php
+1
-1
No files found.
docs/guide/rest.md
View file @
8a3fe891
...
...
@@ -603,17 +603,17 @@ Yii supports all of the above authentication methods. You can also easily create
To enable authentication for your APIs, do the following two steps:
1.
Specify which authentication methods you plan to use by configuring the
`auth`
behavior
1.
Specify which authentication methods you plan to use by configuring the
`auth
enticator
`
behavior
in your REST controller classes.
2.
Implement
[
[yii\web\IdentityInterface::findIdentityByAccessToken()
]
] in your
[
[yii\web\User::identityClass|user identity class
]
].
For example, to enable all three authentication methods explained above, you can configure
`auth`
like following,
For example, to enable all three authentication methods explained above, you can configure
`auth
enticator
`
like following,
```
php
public
function
behaviors
()
{
return
array_merge
(
parent
::
behaviors
(),
[
'auth'
=>
[
'auth
enticator
'
=>
[
'authMethods'
=>
[
\yii\filters\auth\HttpBasicAuth
::
className
(),
\yii\filters\auth\QueryParamAuth
::
className
(),
...
...
@@ -633,7 +633,7 @@ If you only want to a single authentication method, such as HTTP Basic Auth, you
public
function
behaviors
()
{
return
array_merge
(
parent
::
behaviors
(),
[
'auth'
=>
[
'auth
enticator
'
=>
[
'class'
=>
\yii\filters\auth\HttpBasicAuth
::
className
(),
],
]);
...
...
framework/rest/Controller.php
View file @
8a3fe891
...
...
@@ -74,7 +74,7 @@ class Controller extends \yii\web\Controller
'class'
=>
VerbFilter
::
className
(),
'actions'
=>
$this
->
verbs
(),
],
'auth'
=>
[
'auth
enticator
'
=>
[
'class'
=>
CompositeAuth
::
className
(),
],
'rateLimiter'
=>
[
...
...
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