8000 SimplePreAuthenticatorInterface doesn't conform to docs · Issue #11438 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

SimplePreAuthenticatorInterface doesn't conform to docs #11438

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
waldermort opened this issue Jul 22, 2014 · 1 comment
Closed

SimplePreAuthenticatorInterface doesn't conform to docs #11438

waldermort opened this issue Jul 22, 2014 · 1 comment
Labels

Comments

@waldermort
Copy link

Using the latest release, using the SimplePreAuthenticatorInterface as per the docs, results in errors.

Issuing a return null, rather than a return new PreAuthenticatedToken, in createToken() results in a Fatal Error since the AuthenticationProviderManager::authenticate() is expecting a TokenInterface instance. The docs say we can return (filtering URL section) when authentication is not required. Throwing an exception is the only means to exit the method, but, I don't know what others think, using an Exception for this conveys the wrong intention. Also, when used in conjunction with AuthenticationFailureHandlerInterface, throwing an Exception causes the onAuthenticationFailure() method to be called.

In my instance, I'm using it to validate a captch (among other things) on the login screen. I was previously extending UsernamePasswordFormAuthenticationListener to do this, which will cause problems if any other bundle tries to extend the same class. I obviously don't want the captcha to be validated on every page.

What would be the correct Exception to throw from createToken() when we simply don't want to authorize?

@stof
Copy link
Member
stof commented Aug 14, 2014

Closing as duplicate of #11490 (even if it was opened later, the discussion happened there)

@stof stof closed this as completed Aug 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0