當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AbstractToken::setAuthenticated方法代碼示例

本文整理匯總了PHP中Symfony\Component\Security\Core\Authentication\Token\AbstractToken::setAuthenticated方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractToken::setAuthenticated方法的具體用法?PHP AbstractToken::setAuthenticated怎麽用?PHP AbstractToken::setAuthenticated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Security\Core\Authentication\Token\AbstractToken的用法示例。


在下文中一共展示了AbstractToken::setAuthenticated方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setAuthenticated

 /**
  * {@inheritdoc}
  */
 public function setAuthenticated($isAuthenticated)
 {
     if ($isAuthenticated) {
         throw new \LogicException('Cannot set this token to trusted after instantiation.');
     }
     parent::setAuthenticated(false);
 }
開發者ID:appsco,項目名稱:appsco-php-client,代碼行數:10,代碼來源:AppscoToken.php

示例2: __construct

 public function __construct($user, array $attributes = array(), array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->casAttributes = $attributes;
     parent::setAuthenticated(true);
 }
開發者ID:rubenrua,項目名稱:CasBundle,代碼行數:7,代碼來源:CasAuthenticationToken.php

示例3: setAuthenticated

 /**
  * {@inheritdoc}
  */
 public function setAuthenticated($authenticated)
 {
     if ($authenticated) {
         throw new \LogicException('You cannot set this token to authenticated after creation.');
     }
     parent::setAuthenticated(false);
 }
開發者ID:Ener-Getick,項目名稱:symfony,代碼行數:10,代碼來源:RememberMeToken.php

示例4: __construct

 /**
  * @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);
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:14,代碼來源:ImpersonationToken.php

示例5: setAuthenticated

 public function setAuthenticated($bool)
 {
     if ($bool) {
         throw new \LogicException('TwitterUserToken may not be set to authenticated after creation.');
     }
     parent::setAuthenticated(false);
 }
開發者ID:aliel,項目名稱:FOSTwitterBundle,代碼行數:7,代碼來源:TwitterUserToken.php

示例6: __construct

 /**
  * @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);
 }
開發者ID:Irvyne,項目名稱:KnpUGuard,代碼行數:12,代碼來源:PreAuthenticationGuardToken.php

示例7: __construct

 /**
  * 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);
 }
開發者ID:shirone,項目名稱:security-jwt-service-provider,代碼行數:16,代碼來源:JWTToken.php

示例8: __construct

 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);
 }
開發者ID:miguelbemartin,項目名稱:oauth2-php,代碼行數:9,代碼來源:ClientToken.php

示例9: __construct

 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);
 }
開發者ID:Giant-Peach-Design,項目名稱:LiipMagentoBundle,代碼行數:10,代碼來源:MagentoToken.php

示例10: __construct

 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);
 }
開發者ID:dimak08,項目名稱:quiz,代碼行數:11,代碼來源:SocialToken.php

示例11: __construct

 /**
  * @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);
 }
開發者ID:Ener-Getick,項目名稱:symfony,代碼行數:19,代碼來源:PostAuthenticationGuardToken.php

示例12: __construct

 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);
 }
開發者ID:miguelbemartin,項目名稱:oauth2-php,代碼行數:12,代碼來源:AccessTokenToken.php

示例13: __construct

 /**
  * @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);
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:21,代碼來源:PluginToken.php

示例14: __construct

 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);
 }
開發者ID:iamluc,項目名稱:connect,代碼行數:13,代碼來源:ConnectToken.php

示例15: setAuthenticated

 public function setAuthenticated($authenticated)
 {
     parent::setAuthenticated($authenticated);
     return $this;
 }
開發者ID:stof,項目名稱:Antenna,代碼行數:5,代碼來源:Token.php


注:本文中的Symfony\Component\Security\Core\Authentication\Token\AbstractToken::setAuthenticated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。