当前位置: 首页>>代码示例>>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;未经允许,请勿转载。