Skip to content

Commit

Permalink
Bump Symfony requirement to 2.2+ and support 3.0
Browse files Browse the repository at this point in the history
This adds a dependency on PSR-3 but does not present a BC break. Symfony's HttpKernel logger extends PSR-3 since 2.2: symfony/symfony@91a86f8

Allow compatibility with Symfony 3.0

Depend on PSR-3 and bump Symfony requirement to 2.2+
  • Loading branch information
jmikola committed Jun 22, 2016
1 parent 212cce9 commit 56e7a45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
@@ -1,6 +1,6 @@
# AutoLogin

This library implements a Symfony2 security firewall listener to authenticate
This library implements a Symfony security firewall listener to authenticate
users based on a single query parameter. This is useful for providing one-click
login functionality in email and newsletter links.

Expand All @@ -22,10 +22,10 @@ This library requires Symfony 2.1 or above. There is no support for Symfony 2.0.
## Usage

This library implements authentication provider and firewall listener classes,
which may be plugged into Symfony2's security component to intercept requests
which may be plugged into Symfony's security component to intercept requests
and automatically authenticate users based on a single request parameter.

To utilize this library in a full-stack Symfony2 application, you may want to
To utilize this library in a full-stack Symfony application, you may want to
use [JmikolaAutoLoginBundle][]. An example of registering an authentication
provider and firewall listener manually may be found in the
[Silex documentation][] and [Security component documentation][].
Expand All @@ -41,7 +41,7 @@ will be authenticated with an `AutoLoginToken` instance. In the context of
authorization, this token satisfies `IS_AUTHENTICATED_FULLY`. Ideally, it would
be possible to restrict the token to `IS_AUTHENTICATED_REMEMBERED`, but that is
not yet supported. Additional information on these authorization levels may be
found in Symfony2's [authorization documentation][].
found in Symfony's [authorization documentation][].

[authorization documentation]: http://symfony.com/doc/current/components/security/authorization.html

Expand Down
9 changes: 5 additions & 4 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "jmikola/auto-login",
"type": "library",
"description": "Faciliates automatic login via a single token for Symfony2's Security component.",
"description": "Faciliates automatic login via a single token for Symfony's Security component.",
"keywords": ["authentication", "auto-login", "login", "security"],
"homepage": "https://github.com/jmikola/AutoLogin",
"license": "MIT",
Expand All @@ -11,9 +11,10 @@
],
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": "~2.1",
"symfony/http-kernel": "~2.1",
"symfony/security": "~2.1"
"psr/log": "^1.0",
"symfony/event-dispatcher": "^2.2 || ^3.0",
"symfony/http-kernel": "^2.2 || ^3.0",
"symfony/security": "^2.2 || ^3.0"
},
"autoload": {
"psr-0": { "Jmikola\\AutoLogin": "src" }
Expand Down
4 changes: 2 additions & 2 deletions src/Jmikola/AutoLogin/Http/Firewall/AutoLoginListener.php
Expand Up @@ -5,10 +5,10 @@
use Jmikola\AutoLogin\AutoLoginEvents;
use Jmikola\AutoLogin\Authentication\Token\AutoLoginToken;
use Jmikola\AutoLogin\Event\AlreadyAuthenticatedEvent;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
Expand Down Expand Up @@ -113,7 +113,7 @@ public function handle(GetResponseEvent $event)
}
} catch (AuthenticationException $e) {
if (null !== $this->logger) {
$this->logger->warn(
$this->logger->warning(
'SecurityContext not populated with auto-login token as the '.
'AuthenticationManager rejected the auto-login token created '.
'by AutoLoginListener: '.$e->getMessage()
Expand Down

0 comments on commit 56e7a45

Please sign in to comment.