Skip to content

[SecurityBundle] Allow remember-me factory creation when multiple user providers are configured. #26009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2018
Merged

Conversation

iisisrael
Copy link

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR none

When more than one user provider is configured, and remember_me is enabled on a firewall, this avoids the deprecation notice in 3.4 and thrown InvalidConfigurationException in 4.0 ("Not configuring explicitly the provider for the "remember_me" listener on "foo" firewall is ambiguous as there is more than one registered provider."). The RememberMeFactory ignores the $userProvider argument and uses the secret configured for the firewall. (If no secret is configured, it throws its own exception.)

The added test passes in 3.4 with a deprecation notice without the change, so would expect it to fail in 4.0 without the change.

Other tests in the SecurityBundle already included two errors and one failure, not related to this change.

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me, remember_me just does not need a provider.

@nicolas-grekas
Copy link
Member

Thank you @iisisrael.

@nicolas-grekas nicolas-grekas merged commit 6ab8dd9 into symfony:3.4 Feb 4, 2018
nicolas-grekas added a commit that referenced this pull request Feb 4, 2018
…ultiple user providers are configured. (iisisrael)

This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Allow remember-me factory creation when multiple user providers are configured.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

When more than one user provider is configured, and `remember_me` is enabled on a firewall, this avoids the deprecation notice in 3.4 and thrown `InvalidConfigurationException` in 4.0 ("Not configuring explicitly the provider for the "remember_me" listener on "foo" firewall is ambiguous as there is more than one registered provider.").  The `RememberMeFactory` ignores the `$userProvider` argument and uses the secret configured for the firewall.  (If no secret is configured, it throws its own exception.)

The added test passes in 3.4 with a deprecation notice without the change, so would expect it to fail in 4.0 without the change.

Other tests in the `SecurityBundle` already included two errors and one failure, not related to this change.

Commits
-------

6ab8dd9 Allow remember-me factory creation when multiple user providers are configured.
This was referenced Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants