You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/authentication.md
+2-13Lines changed: 2 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,25 +51,14 @@ babdev_websocket:
51
51
firewalls: ['main'] # This can be an array to specify multiple firewalls or a string when specifying a single firewall
52
52
```
53
53
54
-
### Provider Priority
55
-
56
-
When providers are registered to the authenticator service, they are then used in a "first in, first out" order, meaning the order they are triggered will be the same order they are configured in. Assuming your application has multiple authenticators and you want a custom authenticator to be attempted before the session authenticator, you would use the below configuration to do so:
57
-
58
-
```yaml
59
-
babdev_websocket:
60
-
authentication:
61
-
providers:
62
-
custom: ~
63
-
session: ~
64
-
```
65
-
66
54
### Registering New Authenticators
67
55
68
56
In addition to creating a class implementing `BabDev\WebSocketBundle\Authentication\Provider\AuthenticationProvider`, you must also register the authenticator with a `BabDev\WebSocketBundle\DependencyInjection\Factory\Authentication\AuthenticationProviderFactory` to the bundle's container extension. Similar to factories used by Symfony's `SecurityBundle`, this factory is used to allow you to configure the authenticator for your application and build the authentication provider service.
69
57
70
-
A factory is required to have two methods:
58
+
A factory is required to have these methods:
71
59
72
60
- `getKey()`- A unique name to identify the provider in the application configuration, this name is used as the key in the `providers` list
61
+
- `getPriority()`- Defines the priority at which the authentication provider is called
73
62
- `addConfiguration()`- Defines the configuration nodes (if any are required) for the authenticator
74
63
- `createAuthenticationProvider()`- Registers the authentication provider service to the dependency injection container and returns the provider's service ID
if (!$container->hasParameter('security.firewalls')) {
30
62
thrownewRuntimeException('The "firewalls" config for the session authentication provider is not set and the "security.firewalls" container parameter has not been set. Ensure the SecurityBundle is configured or set a list of firewalls to use.');
31
63
}
32
64
33
65
$firewalls = newParameter('security.firewalls');
34
-
} else {
35
-
thrownewInvalidArgumentException(\sprintf('The "firewalls" config must be an array, a string, or null; "%s" given.', get_debug_type($config['firewalls'])));
0 commit comments