Skip to content

Commit

Permalink
[firewall] pass attributes to event.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Apr 4, 2012
1 parent 6232ebc commit 48ddb5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Security/Http/Event/IdentityProvidedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class IdentityProvidedEvent extends Event
*/
protected $identity;

/**
* @var array
*/
protected $attributes;

/**
* @var \Symfony\Component\HttpFoundation\Request
*/
Expand All @@ -24,9 +29,10 @@ class IdentityProvidedEvent extends Event
*/
protected $response;

public function __construct($identity, Request $request)
public function __construct($identity, array $attributes, Request $request)
{
$this->identity = $identity;
$this->attributes = $attributes;
$this->request = $request;
}

Expand All @@ -38,6 +44,14 @@ public function getIdentity()
return $this->request;
}

/**
* @return array
*/
public function getAttributes()
{
return $this->attributes;
}

/**
* @return \Symfony\Component\HttpFoundation\Request
*/
Expand Down
2 changes: 1 addition & 1 deletion Security/Http/Firewall/OpenIdAuthenticationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function attemptAuthentication(Request $request)

if ($result instanceof OpenIdToken) {
if ($this->getDispatcher()) {
$identityProvidedEvent = new IdentityProvidedEvent($result->getIdentity(), $request);
$identityProvidedEvent = new IdentityProvidedEvent($result->getIdentity(), $result->getAttributes(), $request);
$this->getDispatcher()->dispatch(SecurityEvents::IDENTITY_PROVIDED, $identityProvidedEvent);

if ($identityProvidedEvent->getResponse()) {
Expand Down

0 comments on commit 48ddb5e

Please sign in to comment.