> For the complete documentation index, see [llms.txt](https://webauthn-doc.spomky-labs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://webauthn-doc.spomky-labs.com/v2.x-1/the-webauthn-server/the-symfony-way.md).

# The Symfony Way

Symfony is a very popular framework and an official bundle is provided in the package `web-auth/webauthn-symfony-bundle`.

{% hint style="info" %}
If you use Laravel, you may be intersted in [this project: https://github.com/asbiin/laravel-webauthn](https://github.com/asbiin/laravel-webauthn)
{% endhint %}

If you are using Symfony Flex then the bundle will automatically be installed. Otherwise you need to add it in your `AppKernel.php` file:

{% code title="src/AppKernel.php" %}

```php
<?php

public function registerBundles()
{
    $bundles = [
        // ...
        new Webauthn\Bundle\WebauthnBundle(),
    ];
}
```

{% endcode %}

### Entities

At the moment, only Doctrine is supported, however there is no technical constraint to allow other data storage systems.

* [With Doctrine](/v2.x-1/the-webauthn-server/the-symfony-way/entities-with-doctrine.md)

### Configuration

The minimal configuration requires the[ user repository](/v2.x-1/pre-requisites/user-entity-repository.md) and the [pk credential source repository](/v2.x-1/pre-requisites/credential-souce-repository.md).

{% code title="app/config/webauthn.yaml" %}

```yaml
webauthn:
    credential_repository: 'App\Repository\PublicKeyCredentialSourceRepository'
    user_repository: 'App\Repository\PublicKeyCredentialUserEntityRepository'
```

{% endcode %}

Now you may want to:

* [Register your first authenticators](/v2.x-1/the-webauthn-server/the-symfony-way/register-authenticators.md),
* [Authenticate your users](/v2.x-1/the-webauthn-server/the-symfony-way/firewall.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://webauthn-doc.spomky-labs.com/v2.x-1/the-webauthn-server/the-symfony-way.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
