Skip to content

Bugfix/simple authentication provider anonymous token #26808

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

Closed
wants to merge 2 commits into from
Closed

Bugfix/simple authentication provider anonymous token #26808

wants to merge 2 commits into from

Conversation

emarref
Copy link
Contributor

@emarref emarref commented Apr 4, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #26807
License MIT
Doc PR symfony/symfony-docs#...

The checkPreAuth() and checkPostAuth() methods on the UserCheckerInterface expect their argument to be an instance of UserInterface. When the SimpleAuthenticationProvider acquires a token, it doesn't confirm this fact before checking the user. For instance, when the SimpleAuthenticationProvider's SimpleAuthenticatorInterface instance returns an anonymous token (i.e. a token whose getUser() interface returns "anon.") a fatal error is thrown due to the type mismatch when calling the user checker check* methods.

This branch confirms the user is an instance of UserInterface before passing it to the checker.

emarref added 2 commits April 5, 2018 10:36
When an $authToken is anonymous (i.e. getUser() returns 'anon.') a fatal error is thrown due to the user checker expecting arguments to checkPreAuth() and checkPostAuth() to be of the type UserInterface. This commit type-checks the user before passing is to the user checker.
@emarref
Copy link
Contributor Author

emarref commented Apr 4, 2018

Looks like #26788 has addressed this specific issue.

@emarref emarref closed this Apr 4, 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.

2 participants