Reputation:
in a symfony application we have preview domains for our clients. they start with client. if the client is logged in they should not have to enter http basic auth credentials.
So what i want to achieve is:
This is my configuration:
providers:
preview_users:
memory:
users:
'client':
password: 'mypass'
roles: ROLE_PREVIEWER
firewalls:
preview_domain:
provider: preview_users
host: ^client-\d+
http_basic:
realm: "Client Preview"
encoders:
"Symfony\Component\Security\Core\User\User": plaintext
access_control:
- { host: ^client-\d+, roles: ROLE_PREVIEWER }
what am i missing?
Upvotes: 3
Views: 973
Reputation: 4081
Remove single quotes from 'client'
and it will work, the rest of your configuration looks good.
Valid configuration for your provider should be:
providers:
preview_users:
memory:
users:
client:
password: 'mypass'
roles: ROLE_PREVIEWER
See documentation for more details.
Upvotes: 1