setAuthenticated() public method

public setAuthenticated ( $authenticated )
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function setAuthenticated($isAuthenticated)
 {
     if ($isAuthenticated) {
         throw new \LogicException('Cannot set this token to trusted after instantiation.');
     }
     parent::setAuthenticated(false);
 }
Ejemplo n.º 2
0
 public function __construct($user, array $attributes = array(), array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->casAttributes = $attributes;
     parent::setAuthenticated(true);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function setAuthenticated($authenticated)
 {
     if ($authenticated) {
         throw new \LogicException('You cannot set this token to authenticated after creation.');
     }
     parent::setAuthenticated(false);
 }
Ejemplo n.º 4
0
 /**
  * @param string|object            $user         The username (like a nickname, email address, etc.),
  *                                               or a UserInterface instance
  *                                               or an object implementing a __toString method.
  * @param Organization             $organization The organization
  * @param RoleInterface[]|string[] $roles        An array of roles
  */
 public function __construct($user, Organization $organization, array $roles = [])
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->setOrganizationContext($organization);
     parent::setAuthenticated(count($roles) > 0);
 }
Ejemplo n.º 5
0
 public function setAuthenticated($bool)
 {
     if ($bool) {
         throw new \LogicException('TwitterUserToken may not be set to authenticated after creation.');
     }
     parent::setAuthenticated(false);
 }
 /**
  * @param mixed  $credentials
  * @param string $guardProviderKey Unique key that bind this token to a specific GuardAuthenticatorInterface
  */
 public function __construct($credentials, $guardProviderKey)
 {
     $this->credentials = $credentials;
     $this->guardProviderKey = $guardProviderKey;
     parent::__construct(array());
     // never authenticated
     parent::setAuthenticated(false);
 }
 /**
  * Constructor.
  *
  * @param string|object            $user        The user
  * @param mixed                    $context The user credentials
  * @param string                   $providerKey The provider key
  * @param RoleInterface[]|string[] $roles       An array of roles
  */
 public function __construct($user, $context, $providerKey, array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->credentials = $context;
     $this->providerKey = $providerKey;
     parent::setAuthenticated(count($roles) > 0);
 }
Ejemplo n.º 8
0
 public function __construct($providerKey, $clientId, $clientSecret, $redirectUri = '', array $roles = [])
 {
     parent::__construct($roles);
     $this->providerKey = $providerKey;
     $this->clientId = $clientId;
     $this->clientSecret = $clientSecret;
     $this->redirectUri = $redirectUri;
     parent::setAuthenticated(count($roles) > 0);
 }
 public function __construct(UserInterface $user, $providerKey)
 {
     parent::__construct($user->getRoles());
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey must not be empty.');
     }
     $this->providerKey = $providerKey;
     $this->setUser($user);
     parent::setAuthenticated(true);
 }
Ejemplo n.º 10
0
 public function __construct(UserInterface $user, $credentials, $providerKey, array $roles = array())
 {
     parent::__construct($roles);
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey must not be empty.');
     }
     $this->setUser($user);
     $this->credentials = $credentials;
     $this->providerKey = $providerKey;
     parent::setAuthenticated(count($roles) > 0);
 }
 /**
  * @param UserInterface            $user        The user!
  * @param string                   $providerKey The provider (firewall) key
  * @param RoleInterface[]|string[] $roles       An array of roles
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(UserInterface $user, $providerKey, array $roles)
 {
     parent::__construct($roles);
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey (i.e. firewall key) must not be empty.');
     }
     $this->setUser($user);
     $this->providerKey = $providerKey;
     // this token is meant to be used after authentication success, so it is always authenticated
     // you could set it as non authenticated later if you need to
     parent::setAuthenticated(true);
 }
Ejemplo n.º 12
0
 public function __construct($providerKey, $accessToken, $tokenType = '', $clientId = '', $username = '', $expires = '', array $scope = [], array $roles = [])
 {
     parent::__construct($roles);
     $this->providerKey = $providerKey;
     $this->accessToken = $accessToken;
     $this->tokenType = $tokenType;
     $this->clientId = $clientId;
     $this->username = $username;
     $this->expires = $expires;
     $this->scope = $scope;
     parent::setAuthenticated(count($roles) > 0);
 }
Ejemplo n.º 13
0
 /**
  * @param array|\Symfony\Component\Security\Core\Role\RoleInterface[] $providerKey
  * @param null                                                        $authenticatingService
  * @param string                                                      $user
  * @param string                                                      $credentials
  * @param array                                                       $roles
  * @param Response                                                    $response
  */
 public function __construct($providerKey, $authenticatingService = null, $user = '', $credentials = '', array $roles = [], Response $response = null)
 {
     parent::__construct($roles);
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey must not be empty.');
     }
     $this->setUser($user);
     $this->authenticatingService = $authenticatingService;
     $this->credentials = $credentials;
     $this->providerKey = $providerKey;
     $this->response = $response;
     parent::setAuthenticated(count($roles) > 0);
 }
Ejemplo n.º 14
0
 public function __construct($user, $accessToken, User $apiUser = null, $providerKey, $scope = null, array $roles = array())
 {
     parent::__construct($roles);
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey must not be empty.');
     }
     $this->setUser($user);
     $this->setAccessToken($accessToken);
     $this->apiUser = $apiUser;
     $this->providerKey = $providerKey;
     $this->scope = $scope;
     parent::setAuthenticated(count($roles) > 0);
 }
Ejemplo n.º 15
0
 public function setAuthenticated($authenticated)
 {
     parent::setAuthenticated($authenticated);
     return $this;
 }
Ejemplo n.º 16
0
 /**
  * @param Organization             $organization The organization
  * @param RoleInterface[]|string[] $roles        An array of roles
  */
 public function __construct(Organization $organization, array $roles = [])
 {
     parent::__construct($roles);
     $this->setOrganizationContext($organization);
     parent::setAuthenticated(true);
 }
Ejemplo n.º 17
0
 /**
  * @param string $accessToken The OAuth access token
  * @param array  $roles       Roles for the token
  */
 public function __construct($accessToken, array $roles = array())
 {
     parent::__construct($roles);
     $this->accessToken = $accessToken;
     parent::setAuthenticated(count($roles) > 0);
 }