SecurityBundle integration

A user provider is available for your MongoDB projects if you use Symfony SecurityBundle. It works exactly the same way as the entity user provider described in the cookbook:

  • YAML
    1# config/packages/security.yaml security: providers: my_mongo_provider: mongodb: {class: App\Document\User, property: username}
    2
    3
    4
    5
  • XML
    1<!-- config/packages/security.xml --> <config> <provider name="my_mongo_provider"> <mongodb class="App\Document\User" property="username" /> </provider> </config>
    2
    3
    4
    5
    6