Skip to content

Commit 9513635

Browse files
piotaixrmeyerbaptiste
authored andcommitted
Add more information on how install and configure the FOSUserBundle (#256)
1 parent c18f834 commit 9513635

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

core/fosuser-bundle.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
# FOSUser Bundle Integration
22

3-
API Platform Core is shipped with a bridge for [FOSUserBundle](https://github.com/FriendsOfSymfony/FOSUserBundle). If the
4-
FOSUser bundle is enabled, this bridge will use its `UserManager` to create, update and delete user resources.
3+
API Platform Core is shipped with a bridge for [FOSUserBundle](https://github.com/FriendsOfSymfony/FOSUserBundle). If
4+
the FOSUser bundle is enabled, this bridge will use its `UserManager` to create, update and delete user resources.
5+
6+
## Installing the Bundle
7+
8+
The installation procedure of the FOSUserBundle is described [in the main Symfony docs](https://symfony.com/doc/master/bundles/FOSUserBundle/index.html)
9+
10+
You can:
11+
- Skip the [step 3 (Create your User class)](https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-3-create-your-user-class)
12+
and use the class provided in the next paragraph to set up serialization groups the correct way
13+
- Skip the [step 4 (Configure your application's security.yml)](https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml)
14+
if you are planning to [use a JWT-based authentication using `LexikJWTAuthenticationBundle`](jwt.md)
15+
16+
If you are using the API Platform Standard Edition, you will need to enable the form services in the symfony framework
17+
configuration options:
18+
19+
```yaml
20+
# app/config/config.yml
21+
framework:
22+
form: { enabled: true }
23+
```
24+
25+
## Enabling the Bridge
26+
27+
To enable the provided bridge with FOSUserBundle, you need to add the following configuration to api-platform:
28+
```yaml
29+
# app/config/config.yml
30+
api_platform:
31+
enable_fos_user: true
32+
```
533
634
## Creating a `User` Entity with Serialization Groups
735

index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@
8686
3. [Configure it](core/operation-path-naming.md#configure-it)
8787
19. [Accept `application/x-www-form-urlencoded` Form Data](core/form-data.md)
8888
20. [FOSUserBundle Integration](core/fosuser-bundle.md)
89-
1. [Creating a `User` Entity with Serialization Groups](core/fosuser-bundle.md#creating-a-user-entity-with-serialization-groups)
89+
1. [Installing the Bundle](core/fosuser-bundle.md#installing-the-bundle)
90+
2. [Enabling the Bridge](core/fosuser-bundle.md#enabling-the-bridge)
91+
3. [Creating a `User` Entity with Serialization Groups](core/fosuser-bundle.md#creating-a-user-entity-with-serialization-groups)
9092
21. [Adding a JWT authentication using LexikJWTAuthenticationBundle](core/jwt.md)
9193
22. [NelmioApiDocBundle integration](core/nelmio-api-doc.md)
9294
23. [AngularJS Integration](core/angularjs-integration.md)

0 commit comments

Comments
 (0)