PHPackages                             fastartconsulting/user-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fastartconsulting/user-bundle

ActiveSymfony-bundle

fastartconsulting/user-bundle
=============================

FastArtConsulting Symfony UserBundle

1.1.0(7y ago)0112MITPHP

Since Jan 17Pushed 7y agoCompare

[ Source](https://github.com/fastartconsulting/user-bundle)[ Packagist](https://packagist.org/packages/fastartconsulting/user-bundle)[ RSS](/packages/fastartconsulting-user-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (7)Used By (2)

FastART Consulting
==================

[](#fastart-consulting)

UserBundle v1.0 STABLE
======================

[](#userbundle-v10-stable)

This bundle provides a configuration of RESTful API's for User

Integrated with:

- FOS oAuth Server Bundle - friendsofsymfony/oauth-server-bundle
- FOS Rest Bundle - friendsofsymfony/rest-bundle
- FOS User Bundle - friendsofsymfony/user-bundle
- JMS Serializer Bundle - jms/serializer-bundle
- Nelmio CORS Bundle - nelmio/cors-bundle

Documented with:

- Nelmio API DOC Bundle - nelmio/api-doc-bundle

Note
----

[](#note)

FACUserBundle now in Alpha. Soon stable.

Documentation
-------------

[](#documentation)

- Setup
- Configuration

Setup
-----

[](#setup)

- **A) Download the Bundle**

Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

**`composer require fastartconsulting/user-bundle`**

- **B) Add Bundles in AppKernel.php**

Open the file AppKernel.php located inside /app folder and add the following lines:

```
new FOS\RestBundle\FOSRestBundle(),
new FOS\UserBundle\FOSUserBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new FAC\UserBundle\FACUserBundle(),

```

Configuration
-------------

[](#configuration)

- Configure your application's parameters.yml and add valid values for:

```
mailer_user: no-reply@fastartconsulting.com
sender_name: FACUserBundle

```

- Configure your application's config.yml

```
fos_rest:
    routing_loader:
        default_format: json                            # All responses should be JSON formated
        include_format: false                           # We do not include format in request, so that all responses
    view:
        view_response_listener: force
        force_redirects:
            html: true
        formats:
            json: true
            xml: true
    format_listener:
        rules:
            - { path: ^/, priorities: [ json, xml ], fallback_format: json, prefer_extension: true }
    body_converter:
        enabled: true
    #    validate: true
    #    validation_errors_argument: validationErrors
    param_fetcher_listener: true

fos_user:
    db_driver: orm
    firewall_name: api                                  # Seems to be used when registering user/reseting password,
      # but since there is no "login", as so it seems to be useless in
    # our particular context, but still required by "FOSUserBundle"
    user_class: FAC\UserBundle\Entity\User

    # This config is used to user confirmation by sending email
    registration:
        confirmation:
            enabled: true
            template:   email/registration.email.twig

    resetting:
        email:
            template:   email/password_resetting.email.twig

    service:
        mailer: fos_user.mailer.twig_swift
        user_manager: fos_user.user_manager.default
    from_email:
        address:     "%mailer_user%"
        sender_name: "%sender_name%"

fos_oauth_server:
    db_driver:           orm
    client_class:        FAC\UserBundle\Entity\Client
    access_token_class:  FAC\UserBundle\Entity\AccessToken
    refresh_token_class: FAC\UserBundle\Entity\RefreshToken
    auth_code_class:     FAC\UserBundle\Entity\AuthCode
    service:
        #user_provider: fos_user.user_manager             # This property will be used when valid credentials are given to load the user upon access token creation
        user_provider: fos_user.user_provider.username_email

nelmio_api_doc:
  documentation:
    info:
      title: FastArt Bundles
      description: This is an awesome bundles app!
      version: 1.0.0
  areas:
    path_patterns:
      - ^/public(?!/doc$)
      - ^/private(?!/doc$)
      - ^/admin(?!/doc$)
      - ^/super(?!/doc$)

```

- Configure your application's routing.yml

```
fos_oauth_server_token:
    resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
    prefix:   /public

fos_oauth_server_authorize:
    resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml"
    prefix:   /private

FACUserBundle:
    resource: '@FACUserBundle/Controller/'
    type: annotation
    prefix: /

app.swagger_ui:
    path: /doc
    methods: GET
    defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

```

- Configure your application's services.yml

```
######################################
# UserBundle
######################################

fos_oauth_server.controller.authorize:
    class: FAC\UserBundle\Controller\AuthorizeController
    public: true
    tags: ['controller.service_arguments']
    arguments:
        $container: '@service_container'

FAC\UserBundle\:
    resource: '../../vendor/fastartconsulting/user-bundle/*'

FAC\UserBundle\Controller\:
    resource: '../../vendor/fastartconsulting/user-bundle/Controller'
    public: true
    tags: ['controller.service_arguments']

FAC\UserBundle\Service\UserService:
    arguments:
        $emailProcess: 'FAC\UserBundle\Service\UserService'

```

- Configure your application's security.yml

```
# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:

    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

    # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
    providers:
        in_memory:
            memory: ~
        fos_userbundle:
            id: fos_user.user_provider.username_email

    firewalls:
        service:
            entry_point: FAC\UserBundle\Security\AuthenticationEntryPoint
            access_denied_handler: FAC\UserBundle\Security\AccessDeniedHandler
            pattern: ^/public
            security: false

        api:
            entry_point: FAC\UserBundle\Security\AuthenticationEntryPoint
            access_denied_handler: FAC\UserBundle\Security\AccessDeniedHandler
            pattern: ^/private                         # All URLs are protected
            fos_oauth: true                            # OAuth2 protected resource
            stateless: true                            # Do no set session cookies
            anonymous: false                           # Anonymous access is not allowed
            context: oauth_private

        admin:
            entry_point: FAC\UserBundle\Security\AuthenticationEntryPoint
            access_denied_handler: FAC\UserBundle\Security\AccessDeniedHandler
            pattern: ^/admin                           # All URLs are protected
            fos_oauth: true                            # OAuth2 protected resource
            stateless: true                            # Do no set session cookies
            anonymous: false                           # Anonymous access is not allowed
            context: oauth_admin

        super:
            entry_point: FAC\UserBundle\Security\AuthenticationEntryPoint
            access_denied_handler: FAC\UserBundle\Security\AccessDeniedHandler
            pattern: ^/super                           # All URLs are protected
            fos_oauth: true                            # OAuth2 protected resource
            stateless: true                            # Do no set session cookies
            anonymous: false                           # Anonymous access is not allowed
            context: oauth_super

        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            anonymous: ~
            access_denied_handler: FAC\UserBundle\Security\AccessDeniedHandler
            # activate different ways to authenticate

            # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
            #http_basic: ~

            # https://symfony.com/doc/current/security/form_login_setup.html
            #form_login: ~

        oauth_token:                                   # Everyone can access the access token URL.
            pattern: ^/oauth/v2/token
            security: false

        oauth_authorize:
            pattern: ^/oauth/v2/auth
            form_login:
                provider: fos_userbundle
                check_path: fos_user_security_login
                login_path: fos_user_security_check
                csrf_token_generator: security.csrf.token_manager
            anonymous: true
            context: test_connect

        #api:
        #    pattern: ^/
        #    fos_oauth: true                            # OAuth2 protected resource
        #    stateless: true                            # Do no set session cookies
        #    anonymous: false                           # Anonymous access is not allowed

    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/oauth/v2/, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/public, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/private, role: ROLE_USER }
        - { path: ^/admin, role: ROLE_ADMIN }
        - { path: ^/super, role: ROLE_SUPER_ADMIN }

```

- Run Server and Enjoy ;)

After

```
php bin/console doctrine:schema:update --force
php bin/console server:start

```

you can see the API's on 127.0.0.1/doc

Our integrations
----------------

[](#our-integrations)

License
-------

[](#license)

This bundle is under the MIT license.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

6

Last Release

2643d ago

Major Versions

v0.9-alpha → 1.02019-01-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/19610bac3ece6207d45a82f2eb054795957d60a2a5c44013be46b848645a6efb?d=identicon)[lmangiacotti](/maintainers/lmangiacotti)

---

Top Contributors

[![lucafastart](https://avatars.githubusercontent.com/u/46672608?v=4)](https://github.com/lucafastart "lucafastart (11 commits)")

### Embed Badge

![Health badge](/badges/fastartconsulting-user-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/fastartconsulting-user-bundle/health.svg)](https://phpackages.com/packages/fastartconsulting-user-bundle)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[claroline/core-bundle

Claroline core bundle

165.5k43](/packages/claroline-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
