Skip to content

Commit 9f41a1f

Browse files
committed
Merge pull request #370 from vinkla/config
Add spacing and make line max 80 chars in config file
2 parents 996c049 + ca9cf3d commit 9f41a1f

File tree

1 file changed

+36
-68
lines changed

1 file changed

+36
-68
lines changed

config/oauth2.php

Lines changed: 36 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,27 @@
77
| Database Connection to use
88
|--------------------------------------------------------------------------
99
|
10-
| Set the default database connection to use for the repositories,
11-
| when set to default, it uses whatever connection you specified in your laravel db config.
10+
| Set the default database connection to use for the repositories, when
11+
| set to default, it uses whatever connection you specified in your
12+
| laravel database config.
1213
|
1314
*/
15+
1416
'database' => 'default',
1517

1618
/*
1719
|--------------------------------------------------------------------------
1820
| Supported Grant Types
1921
|--------------------------------------------------------------------------
2022
|
21-
| Your OAuth2 Server can issue an access token based on different grant types
22-
| you can even provide your own grant type.
23-
| To choose which grant type suits your scenario, see
24-
| https://github.com/php-loep/oauth2-server/wiki/Which-OAuth-2.0-grant-should-I-use%3F
25-
|
26-
| Available grant types are:
27-
|
28-
| 'grant_types' => [
29-
|
30-
| 'authorization_code' => [
31-
| 'class' => 'League\OAuth2\Server\Grant\AuthCodeGrant',
32-
| 'access_token_ttl' => 3600,
33-
|
34-
| // the authorization code time to live
35-
| 'auth_token_ttl' => 3600,
36-
| ],
37-
|
38-
| 'password' => [
39-
| 'class' => 'League\OAuth2\Server\Grant\PasswordGrant',
40-
| 'access_token_ttl' => 604800,
41-
|
42-
| // the code to run in order to verify the user's identity
43-
| 'callback' => function($username, $password){
44-
| $credentials = [
45-
| 'email' => $username,
46-
| 'password' => $password,
47-
| ];
48-
|
49-
| if (Auth::once($credentials)) {
50-
| return Auth::user()->id;
51-
| } else {
52-
| return false;
53-
| }
54-
| }
55-
| ],
56-
|
57-
| 'client_credentials' => [
58-
| 'class' => 'League\OAuth2\Server\Grant\ClientCredentialsGrant',
59-
| 'access_token_ttl' => 3600,
60-
| ],
61-
|
62-
| 'refresh_token' => [
63-
| 'class' => 'League\OAuth2\Server\Grant\RefreshTokenGrant',
64-
| 'access_token_ttl' => 3600,
65-
|
66-
| // the refresh token time to live
67-
| 'refresh_token_ttl' => 604800,
23+
| Your OAuth2 Server can issue an access token based on different grant
24+
| types you can even provide your own grant type.
6825
|
69-
| // whether or not to issue a new refresh token when a new access token is issued
70-
| 'rotate_refresh_tokens' => false,
71-
| ],
26+
| To choose which grant type suits your scenario, see
27+
| http://oauth2.thephpleague.com/authorization-server/which-grant
7228
|
73-
| ],
29+
| Please see this link to find available grant types
30+
| http://git.io/vJLAv
7431
|
7532
*/
7633

@@ -83,96 +40,105 @@
8340
| Output Token Type
8441
|--------------------------------------------------------------------------
8542
|
86-
| This will tell the authorization server the output format for the access token
87-
| and will tell the resource server how to parse the access token used.
43+
| This will tell the authorization server the output format for the access
44+
| token and the resource server how to parse the access token used.
8845
|
8946
| Default value is League\OAuth2\Server\TokenType\Bearer
9047
|
9148
*/
49+
9250
'token_type' => 'League\OAuth2\Server\TokenType\Bearer',
9351

9452
/*
9553
|--------------------------------------------------------------------------
9654
| State Parameter
9755
|--------------------------------------------------------------------------
9856
|
99-
| Whether or not the state parameter is required in the query string
57+
| Whether or not the state parameter is required in the query string.
10058
|
10159
*/
60+
10261
'state_param' => false,
10362

10463
/*
10564
|--------------------------------------------------------------------------
10665
| Scope Parameter
10766
|--------------------------------------------------------------------------
10867
|
109-
| Whether or not the scope parameter is required in the query string
68+
| Whether or not the scope parameter is required in the query string.
11069
|
11170
*/
71+
11272
'scope_param' => false,
11373

11474
/*
11575
|--------------------------------------------------------------------------
11676
| Scope Delimiter
11777
|--------------------------------------------------------------------------
11878
|
119-
| Which character to use to split the scope parameter in the query string
79+
| Which character to use to split the scope parameter in the query string.
12080
|
12181
*/
82+
12283
'scope_delimiter' => ',',
12384

12485
/*
12586
|--------------------------------------------------------------------------
12687
| Default Scope
12788
|--------------------------------------------------------------------------
12889
|
129-
| The default scope to use if not present in the query string
90+
| The default scope to use if not present in the query string.
13091
|
13192
*/
93+
13294
'default_scope' => null,
13395

13496
/*
13597
|--------------------------------------------------------------------------
13698
| Access Token TTL
13799
|--------------------------------------------------------------------------
138100
|
139-
| For how long the issued access token is valid (in seconds)
140-
| this can be also set on a per grant-type basis
101+
| For how long the issued access token is valid (in seconds) this can be
102+
| also set on a per grant-type basis.
141103
|
142104
*/
105+
143106
'access_token_ttl' => 3600,
144107

145108
/*
146109
|--------------------------------------------------------------------------
147110
| Limit clients to specific grants
148111
|--------------------------------------------------------------------------
149112
|
150-
| Whether or not to limit clients to specific grant types
151-
| This is useful to allow only trusted clients to access your API differently
113+
| Whether or not to limit clients to specific grant types. This is useful
114+
| to allow only trusted clients to access your API differently.
152115
|
153116
*/
117+
154118
'limit_clients_to_grants' => false,
155119

156120
/*
157121
|--------------------------------------------------------------------------
158122
| Limit clients to specific scopes
159123
|--------------------------------------------------------------------------
160124
|
161-
| Whether or not to limit clients to specific scopes
162-
| This is useful to only allow specific clients to use some scopes
125+
| Whether or not to limit clients to specific scopes. This is useful to
126+
| only allow specific clients to use some scopes.
163127
|
164128
*/
129+
165130
'limit_clients_to_scopes' => false,
166131

167132
/*
168133
|--------------------------------------------------------------------------
169134
| Limit scopes to specific grants
170135
|--------------------------------------------------------------------------
171136
|
172-
| Whether or not to limit scopes to specific grants
173-
| This is useful to allow certain scopes to be used only with certain grant types
137+
| Whether or not to limit scopes to specific grants. This is useful to
138+
| allow certain scopes to be used only with certain grant types.
174139
|
175140
*/
141+
176142
'limit_scopes_to_grants' => false,
177143

178144
/*
@@ -181,8 +147,10 @@
181147
|--------------------------------------------------------------------------
182148
|
183149
| This will tell the resource server where to check for the access_token.
184-
| By default it checks both the query string and the http headers
150+
| By default it checks both the query string and the http headers.
185151
|
186152
*/
153+
187154
'http_headers_only' => false,
155+
188156
];

0 commit comments

Comments
 (0)