@@ -231,7 +231,7 @@ class AuthCode extends BaseAuthCode
231
231
}
232
232
```
233
233
234
- __ Note__ : If you don't have ` auto_mapping ` activated in your doctrine configuration you need to add
234
+ __ Note__ : If you don't have ` auto_mapping ` activated in your doctrine configuration you need to add
235
235
` FOSOAuthServerBundle ` to your mappings in ` config.yml ` .
236
236
237
237
#### Propel
@@ -241,7 +241,7 @@ You have to install the [TypehintableBehavior](https://github.com/willdurand/Typ
241
241
242
242
By using [ Composer] ( http://getcomposer.org ) , you just have to add the following line in your ` composer.json ` :
243
243
244
- ``` js
244
+ ``` json
245
245
{
246
246
"require" : {
247
247
"willdurand/propel-typehintable-behavior" : " *"
@@ -285,10 +285,9 @@ namespace Acme\ApiBundle\Document;
285
285
286
286
use FOS\OAuthServerBundle\Document\Client as BaseClient;
287
287
288
- class Client extends BaseClient
288
+ class Client extends BaseClient
289
289
{
290
290
protected $id;
291
-
292
291
}
293
292
```
294
293
@@ -303,9 +302,9 @@ class Client extends BaseClient
303
302
<document name =" Acme\ApiBundle\Document\Client" db =" acme" collection =" oauthClient" customId =" true" >
304
303
<field fieldName =" id" id =" true" strategy =" AUTO" />
305
304
</document >
306
-
305
+
307
306
</doctrine-mongo-mapping >
308
- ```
307
+ ```
309
308
310
309
``` php
311
310
<?php
@@ -317,11 +316,11 @@ namespace Acme\ApiBundle\Document;
317
316
use FOS\OAuthServerBundle\Document\AuthCode as BaseAuthCode;
318
317
use FOS\OAuthServerBundle\Model\ClientInterface;
319
318
320
- class AuthCode extends BaseAuthCode
319
+ class AuthCode extends BaseAuthCode
321
320
{
322
321
protected $id;
323
322
protected $client;
324
-
323
+
325
324
public function getClient()
326
325
{
327
326
return $this->client;
@@ -331,9 +330,7 @@ class AuthCode extends BaseAuthCode
331
330
{
332
331
$this->client = $client;
333
332
}
334
-
335
333
}
336
-
337
334
```
338
335
339
336
``` xml
@@ -348,9 +345,9 @@ class AuthCode extends BaseAuthCode
348
345
<field fieldName =" id" id =" true" strategy =" AUTO" />
349
346
<reference-one target-document =" Acme\ApiBundle\Document\Client" field =" client" />
350
347
</document >
351
-
348
+
352
349
</doctrine-mongo-mapping >
353
- ```
350
+ ```
354
351
355
352
``` php
356
353
<?php
@@ -362,11 +359,11 @@ namespace Acme\ApiBundle\Document;
362
359
use FOS\OAuthServerBundle\Document\AccessToken as BaseAccessToken;
363
360
use FOS\OAuthServerBundle\Model\ClientInterface;
364
361
365
- class AccessToken extends BaseAccessToken
362
+ class AccessToken extends BaseAccessToken
366
363
{
367
364
protected $id;
368
365
protected $client;
369
-
366
+
370
367
public function getClient()
371
368
{
372
369
return $this->client;
@@ -376,7 +373,6 @@ class AccessToken extends BaseAccessToken
376
373
{
377
374
$this->client = $client;
378
375
}
379
-
380
376
}
381
377
```
382
378
@@ -392,9 +388,9 @@ class AccessToken extends BaseAccessToken
392
388
<field fieldName =" id" id =" true" strategy =" AUTO" />
393
389
<reference-one target-document =" Acme\ApiBundle\Document\Client" field =" client" />
394
390
</document >
395
-
391
+
396
392
</doctrine-mongo-mapping >
397
- ```
393
+ ```
398
394
399
395
``` php
400
396
<?php
@@ -406,11 +402,11 @@ namespace Acme\ApiBundle\Document;
406
402
use FOS\OAuthServerBundle\Document\RefreshToken as BaseRefreshToken;
407
403
use FOS\OAuthServerBundle\Model\ClientInterface;
408
404
409
- class RefreshToken extends BaseRefreshToken
405
+ class RefreshToken extends BaseRefreshToken
410
406
{
411
407
protected $id;
412
408
protected $client;
413
-
409
+
414
410
public function getClient()
415
411
{
416
412
return $this->client;
@@ -420,7 +416,6 @@ class RefreshToken extends BaseRefreshToken
420
416
{
421
417
$this->client = $client;
422
418
}
423
-
424
419
}
425
420
```
426
421
@@ -436,9 +431,9 @@ class RefreshToken extends BaseRefreshToken
436
431
<field fieldName =" id" id =" true" strategy =" AUTO" />
437
432
<reference-one target-document =" Acme\ApiBundle\Document\Client" field =" client" />
438
433
</document >
439
-
434
+
440
435
</doctrine-mongo-mapping >
441
- ```
436
+ ```
442
437
443
438
### Step 4: Configure your application's security.yml
444
439
@@ -581,8 +576,8 @@ $client->setAllowedGrantTypes(array('token', 'authorization_code'));
581
576
$clientManager->updateClient($client);
582
577
` ` `
583
578
584
- Once you have created a client, you need to pass its `publicId` to the authorize endpoint. You also need
585
- to specify a redirect uri as well as a response type.
579
+ Once you have created a client, you need to pass its `publicId` to the authorize endpoint. You also need
580
+ to specify a redirect uri as well as a response type.
586
581
587
582
` ` ` php
588
583
return $this->redirect($this->generateUrl('fos_oauth_server_authorize', array(
0 commit comments