Skip to content

Commit 2b496cb

Browse files
authored
Merge pull request #147 from filsh/readme-updates
fix: updated README.md
2 parents 155cd7e + 4573d99 commit 2b496cb

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ To use this extension, simply add the following code in your application config
5050

5151
```common\models\User``` - user model implementing an interface ```\OAuth2\Storage\UserCredentialsInterface```, so the oauth2 credentials data stored in user table
5252

53-
Additional OAuth2 Flags:
53+
You can pass additional OAuth2 Server Options by setting `options` property on the module. Some of them are implemented as standalone properties on the module: `tokenParamName`, `tokenAccessLifetime`, `useJwtToken`. For a full list of the supported options go to the - [source code](https://github.com/bshaffer/oauth2-server-php/blob/5a0c8000d4763b276919e2106f54eddda6bc50fa/src/OAuth2/Server.php#L162).
5454

55-
```enforceState``` - Flag that switch that state controller should allow to use "state" param in the "Authorization Code" Grant Type
5655

57-
```allowImplicit``` - Flag that switch that controller should allow the "implicit" grant type
5856

59-
The next step your shold run migration
57+
The next step you should run migration
6058

6159
```php
6260
yii migrate --migrationPath=@vendor/filsh/yii2-oauth2-server/migrations
6361
```
6462

65-
this migration create the oauth2 database scheme and insert test user credentials ```testclient:testpass``` for ```http://fake/```
63+
this migration creates the oauth2 database scheme and insert test user credentials ```testclient:testpass``` for ```http://fake/```
6664

6765
add url rule to urlManager
6866

@@ -142,7 +140,7 @@ class SiteController extends Controller
142140
}
143141
```
144142

145-
Also, if you set ```allowImplicit => true``` you can use Implicit Grant Type - [see more](http://bshaffer.github.io/oauth2-server-php-docs/grant-types/implicit/)
143+
Also, if you set ```allow_implicit => true``` in the ```options``` property of the module, you can use Implicit Grant Type - [see more](http://bshaffer.github.io/oauth2-server-php-docs/grant-types/implicit/)
146144

147145
Request example:
148146

src/Module.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ class Module extends \yii\base\Module
5858
* @var string name of access token parameter
5959
*/
6060
public $tokenParamName;
61-
6261
/**
6362
* @var type max access lifetime
6463
*/
6564
public $tokenAccessLifetime;
6665
/**
6766
* @var whether to use JWT tokens
6867
*/
69-
public $useJwtToken = false;//ADDED
70-
68+
public $useJwtToken = false;
69+
70+
7171
/**
7272
* @inheritdoc
7373
*/
@@ -126,7 +126,7 @@ public function getServer()
126126
$this,
127127
$storages,
128128
array_merge(array_filter([
129-
'use_jwt_access_tokens' => $this->useJwtToken,//ADDED
129+
'use_jwt_access_tokens' => $this->useJwtToken,
130130
'token_param_name' => $this->tokenParamName,
131131
'access_lifetime' => $this->tokenAccessLifetime,
132132
/** add more ... */

0 commit comments

Comments
 (0)