summaryrefslogtreecommitdiffstats
path: root/Guard
Commit message (Collapse)AuthorAgeFilesLines
* Write the log message on a single line againnDiego Agulló2015-11-031-4/+1
|
* Check whether $this->logger is not null on GuardAuthenticationListenerDiego Agulló2015-11-011-1/+6
|
* feature #16395 checkCredentials() force it to be an affirmative yes! ↵Fabien Potencier2015-10-313-3/+45
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (weaverryan) This PR was squashed before being merged into the 2.8 branch (closes #16395). Discussion ---------- checkCredentials() force it to be an affirmative yes! | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no (because 2.8 isn't released) | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This changes `GuardAuthenticatorInterface::checkCredentials()`: you now *must* return true in order for authentication to pass. Before: You could do nothing (i.e. return null) and authentication would pass. You threw an AuthenticationException to cause a failure. New: You *must* return `true` for authentication to pass. If you do nothing, we will throw a `BadCredentialsException` on your behalf. You can still throw your own exception. This was a suggestion at symfony_live to make things more secure. I think it makes sense. Commits ------- 14acadd checkCredentials() force it to be an affirmative yes!
| * checkCredentials() force it to be an affirmative yes!Ryan Weaver2015-10-313-3/+45
| |
* | Merge branch '2.7' into 2.8Fabien Potencier2015-10-301-1/+4
|/ | | | | | | | | * 2.7: added the new Composer exclude-from-classmap option added the new Composer exclude-from-classmap option fix expected argument type docblock Set back libxml settings after testings. fixed Twig deprecation notices
* [PhpUnit] Auto-register SymfonyTestsListenerNicolas Grekas2015-10-111-4/+0
|
* Merge branch '2.7' into 2.8Nicolas Grekas2015-10-102-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7: [tests] Use @requires annotation when possible [tests] Use @requires annotation when possible [ci] Enable collecting and replaying skipped tests [Process] Workaround buggy PHP warning [Console] Add additional ways to detect OS400 platform [Yaml] Allow tabs before comments at the end of a line Added more tests for PropertyAccess Conflicts: .travis.yml src/Symfony/Bridge/Doctrine/composer.json src/Symfony/Bridge/Monolog/composer.json src/Symfony/Bridge/ProxyManager/composer.json src/Symfony/Bridge/Swiftmailer/composer.json src/Symfony/Bridge/Twig/composer.json src/Symfony/Bundle/DebugBundle/composer.json src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Bundle/SecurityBundle/composer.json src/Symfony/Bundle/TwigBundle/composer.json src/Symfony/Bundle/WebProfilerBundle/composer.json src/Symfony/Component/Asset/composer.json src/Symfony/Component/BrowserKit/composer.json src/Symfony/Component/ClassLoader/composer.json src/Symfony/Component/Config/composer.json src/Symfony/Component/Console/composer.json src/Symfony/Component/CssSelector/composer.json src/Symfony/Component/Debug/composer.json src/Symfony/Component/DependencyInjection/composer.json src/Symfony/Component/DomCrawler/composer.json src/Symfony/Component/EventDispatcher/composer.json src/Symfony/Component/ExpressionLanguage/composer.json src/Symfony/Component/Filesystem/composer.json src/Symfony/Component/Finder/composer.json src/Symfony/Component/Form/composer.json src/Symfony/Component/HttpFoundation/composer.json src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Intl/composer.json src/Symfony/Component/Locale/composer.json src/Symfony/Component/OptionsResolver/composer.json src/Symfony/Component/Process/composer.json src/Symfony/Component/PropertyAccess/composer.json src/Symfony/Component/Routing/composer.json src/Symfony/Component/Security/Acl/composer.json src/Symfony/Component/Security/Core/composer.json src/Symfony/Component/Security/Csrf/composer.json src/Symfony/Component/Security/Http/composer.json src/Symfony/Component/Security/composer.json src/Symfony/Component/Serializer/composer.json src/Symfony/Component/Stopwatch/composer.json src/Symfony/Component/Templating/composer.json src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php src/Symfony/Component/Translation/composer.json src/Symfony/Component/Validator/composer.json src/Symfony/Component/VarDumper/composer.json src/Symfony/Component/Yaml/composer.json
* bug #15925 Updating behavior to not continue after an authenticator has set ↵Fabien Potencier2015-09-272-8/+47
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the response (weaverryan) This PR was merged into the 2.8 branch. Discussion ---------- Updating behavior to not continue after an authenticator has set the response | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony/pull/14673/files#r40492765 | License | MIT | Doc PR | n/a This mirrors the behavior in core: *if* a listener sets a response (on success or failure), then the other listeners are not called. But if a response is *not* set (which is sometimes the case for success, like in BasicAuthenticationListener), then the other listeners are called, and can even fail. It's all a bit of an edge-case, as only one authenticator (like authentication listener) would normally be doing any work on a request, but I think matching the other listeners (since I'm not aware of anyone having issues with its behavior) is best. Commits ------- 5fa2684 Making all "debug" messages use the debug router f403444 Updating behavior to not continue after an authenticator has set the response
| * Making all "debug" messages use the debug routerRyan Weaver2015-09-261-8/+8
| | | | | | | | | | Only the "auth success" and "auth failed" messages remain at info. That's consistent with AbstractAuthenticationListener
| * Updating behavior to not continue after an authenticator has set the responseRyan Weaver2015-09-262-1/+40
| | | | | | | | | | | | | | This mirrors the behavior in core: *if* a listener sets a response (on success or failure), then the other listeners are not called. But if a response is *not* set (which is sometimes the case for success, like in BasicAuthenticationListener), then the other listeners are called, and can even fail.
* | bug #15927 Making GuardTokenInterface extend TokenInterface (weaverryan)Fabien Potencier2015-09-271-1/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR was merged into the 2.8 branch. Discussion ---------- Making GuardTokenInterface extend TokenInterface | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15884 | License | MIT | Doc PR | n/a See #15884 Commits ------- 7f04fbb Making GuardTokenInterface extend TokenInterface
| * | Making GuardTokenInterface extend TokenInterfaceRyan Weaver2015-09-261-1/+3
| |/ | | | | | | | | This makes some of our type-hints more honest: i.e. where we look for a GuardTokenInterface, but really also expect it to implement TokenInterface.
* | Minor tweaks - lowering the required security-http requirement and nulling ↵Ryan Weaver2015-09-262-1/+2
|/ | | | out a test field
* Adding the necessary files so that Guard can be its own installable componentRyan Weaver2015-09-235-0/+113
|
* Removing unnecessary overrideRyan Weaver2015-09-221-12/+0
|
* fabbotRyan Weaver2015-09-203-14/+12
|
* Adding a new exception and throwing it when the User changesRyan Weaver2015-09-202-4/+6
| | | | | | | | | | | This is quite technical. As you can see in the provider, the method is called sometimes when the User changes, and so the token becomes de-authenticated (e.g. someone else changes the password between requests). In practice, the user should be unauthenticated. Using the anonymous token did this, but throwing an AccountStatusException seems like a better idea. It needs to be an AccountStatusException because the ExceptionListener from the Firewall looks for exceptions of this class and logs the user out when they are found (because this is their purpose).
* Fixing a bug where having an authentication failure would log you out.Ryan Weaver2015-09-204-8/+55
| | | | | | | | | | This solution is a copy of what AbstractAuthenticationListener does. Scenario: 1) Login 2) Go back to the log in page 3) Put in a bad user/pass You *should* still be logged in after a failed attempt. This commit gives that behavior.
* Tweaks thanks to WouterRyan Weaver2015-09-202-6/+3
|
* Adding logging on this step and switching the order - not for any huge reasonRyan Weaver2015-09-201-3/+7
|
* Adding a base class to assist with form login authenticationRyan Weaver2015-09-201-0/+104
|
* Allowing for other authenticators to be checkedRyan Weaver2015-09-201-4/+2
| | | | | If you have 2 firewalls, 2 GuardAuthenticationProviders are still created, so we need to be able to run through both of them.
* meaningless author and license changesRyan Weaver2015-09-208-11/+83
|
* Thanks again fabbot!Ryan Weaver2015-09-201-4/+4
|
* A few more changes thanks to @iltarRyan Weaver2015-09-201-4/+4
|
* Splitting the getting of the user and checking credentials into two stepsRyan Weaver2015-09-203-12/+41
| | | | | | | This looks like a subjective change (one more method, but the method implementations are simpler), but it wasn't. The problem was that the UserChecker checkPreAuth should happen *after* we get the user, but *before* the credentials are checked, and that wasn't possible before this change. Now it is.
* Tweaking docblock on interface thanks to @iltarRyan Weaver2015-09-201-3/+4
|
* Adding periods at the end of exceptions, and changing one class name to ↵Ryan Weaver2015-09-204-8/+8
| | | | LogicException thanks to @iltar
* Updating interface method per suggestion - makes sense to me, Request is ↵Ryan Weaver2015-09-203-9/+9
| | | | redundant
* Thanks fabbot!Ryan Weaver2015-09-207-48/+59
|
* Adding an edge case - this should not happen anywaysRyan Weaver2015-09-202-1/+9
|
* Properly handles "post auth" tokens that have become not authenticatedRyan Weaver2015-09-202-0/+31
| | | | | | | | | | | | | Here is the flow: A) You login using guard and are given a PostAuthGuardToken B) Your user changes between requests - AbstractToken::setUser() and hasUserChanged() - which results in the Token becoming "not authenticated" C) Something calls out to the security system, which then passes the no-longer-authed token back into the AuthenticationProviderManager D) Because the PostauthGuardToken implements GuardTokenInterface, the provider responds to it. But, seeing that this is a no-longer-authed PostAuthGuardToken, it returns an AnonymousToken, which triggers logout
* Renaming the tokens to be clear they are "post" and "pre" auth - also adding ↵Ryan Weaver2015-09-208-30/+45
| | | | | | | | | | | | | an interface The reason is that the GuardAuthenticationProvider *must* respond to *all* tokens created by the system - both "pre auth" and "post auth" tokens. The reason is that if a "post auth" token becomes not authenticated (e.g. because the user changes between requests), then it may be passed to the provider system. If no providers respond (which was the case before this commit), then AuthenticationProviderManager throws an exception. The next commit will properly handle these "post auth" + "no-longer-authenticated" tokens, which should cause a log out.
* Initial commit (but after some polished work) of the new Guard ↵Ryan Weaver2015-09-2010-0/+1124
authentication system