当前位置: 首页>>代码示例>>PHP>>正文


PHP TokenInterface::getProviderKey方法代码示例

本文整理汇总了PHP中Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getProviderKey方法的典型用法代码示例。如果您正苦于以下问题:PHP TokenInterface::getProviderKey方法的具体用法?PHP TokenInterface::getProviderKey怎么用?PHP TokenInterface::getProviderKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Security\Core\Authentication\Token\TokenInterface的用法示例。


在下文中一共展示了TokenInterface::getProviderKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: supportsToken

 /**
  * @return boolean
  */
 public function supportsToken(TokenInterface $token, $providerKey)
 {
     if (!$token instanceof PreAuthenticatedToken) {
         return false;
     }
     return $token->getProviderKey() === $providerKey;
 }
开发者ID:Tekstove,项目名称:Tekstove-api,代码行数:10,代码来源:ApiKeyAuthenticator.php

示例2: supportsToken

 /**
  * {@inheritdoc}
  */
 public function supportsToken(TokenInterface $token, $providerKey)
 {
     if (!$token instanceof WebTokenToken) {
         return false;
     }
     return $providerKey == $token->getProviderKey();
 }
开发者ID:formvault,项目名称:Antenna,代码行数:10,代码来源:TokenAuthenticator.php

示例3: onAuthenticationSuccess

 /**
  * Triggered on successful login.
  *
  * @param Request $request
  * @param TokenInterface $token
  * 
  * @return RedirectResponse
  */
 public function onAuthenticationSuccess(Request $request, TokenInterface $token)
 {
     // clean up some session data used at login
     $request->getSession()->remove(AsnUsernamePasswordFormAuthenticationListener::LAST_ASN);
     $targetPathString = sprintf('_security.%s.target_path', $token->getProviderKey());
     // if we were redirected to login after accessing a secure url, return back to the url
     if ($request->getSession()->has($targetPathString)) {
         $targetUrl = $request->getSession()->get($targetPathString);
         // clean the session
         $request->getSession()->remove($targetPathString);
     } else {
         $targetUrl = '/';
     }
     return new RedirectResponse($targetUrl);
 }
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:23,代码来源:LoginSuccessHandler.php

示例4: onAuthenticationSuccess

 public function onAuthenticationSuccess(Request $request, TokenInterface $token)
 {
     $em = $this->container->get('doctrine')->getManager();
     $failureRepo = $em->getRepository('AppFrontBundle:Loginfailure');
     $failureRepo->removeFailures($token->getUser(), $request->server->get('REMOTE_ADDR'));
     if ($request->isXmlHttpRequest()) {
         $response = new JsonResponse(array('success' => true, 'username' => $token->getUsername()));
     } else {
         $referer = $request->getSession()->get('_security.' . $token->getProviderKey() . '.target_path');
         if ($referer) {
             $response = new RedirectResponse($referer);
         } else {
             $response = parent::onAuthenticationSuccess($request, $token);
         }
     }
     return $response;
 }
开发者ID:bebetojefry,项目名称:symfony-2,代码行数:17,代码来源:AuthenticationSuccessHandler.php

示例5: supports

 /**
  * @see Symfony\Component\Security\Core\Authentication\Provider\uthenticationProviderInterface::supports()
  */
 public function supports(TokenInterface $token)
 {
     return $token instanceof AutoLoginToken && $token->getProviderKey() === $this->providerKey;
 }
开发者ID:cmyker,项目名称:AutoLogin,代码行数:7,代码来源:AutoLoginProvider.php

示例6: supports

 /**
  * {@inheritdoc}
  */
 public function supports(TokenInterface $token)
 {
     return $token instanceof UsernamePasswordToken && $this->providerKey === $token->getProviderKey();
 }
开发者ID:GeorgeBroadley,项目名称:caffeine-vendor,代码行数:7,代码来源:UserAuthenticationProvider.php

示例7: isAdminToken

 /**
  * @param TokenInterface $token
  * @param                $providerKey
  *
  * @return bool
  */
 private function isAdminToken($providerKey, TokenInterface $token = null)
 {
     return ($token instanceof UsernamePasswordToken || $token instanceof RememberMeToken) && $token->getProviderKey() === $providerKey;
 }
开发者ID:axelvnk,项目名称:KunstmaanBundlesCMS,代码行数:10,代码来源:AdminLocaleListener.php

示例8: isAdminToken

 /**
  * @param TokenInterface $token
  * @param                $providerKey
  *
  * @return bool
  */
 private function isAdminToken(TokenInterface $token, $providerKey)
 {
     return $token instanceof UsernamePasswordToken && $token->getProviderKey() === $providerKey;
 }
开发者ID:headonkeyboard,项目名称:KunstmaanBundlesCMS,代码行数:10,代码来源:AdminLocaleListener.php

示例9: supports

 /**
  * {@inheritdoc}
  */
 public function supports(TokenInterface $token)
 {
     return $token instanceof PreAuthenticatedToken && $this->providerKey === $token->getProviderKey();
 }
开发者ID:NivalM,项目名称:VacantesJannaMotors,代码行数:7,代码来源:PreAuthenticatedAuthenticationProvider.php

示例10: supports

 /**
  * {@inheritdoc}
  */
 public function supports(TokenInterface $token)
 {
     return $token instanceof OrganizationRememberMeToken && $this->providerKey === $token->getProviderKey();
 }
开发者ID:xamin123,项目名称:platform,代码行数:7,代码来源:OrganizationRememberMeAuthenticationProvider.php

示例11: supports

 public function supports(TokenInterface $token)
 {
     return $token instanceof TelenorUserToken && $this->providerKey == $token->getProviderKey() && $this->validateIfTokenIsNotExpired($token);
 }
开发者ID:arghakroy,项目名称:Bangla-Radio,代码行数:4,代码来源:TelenorAuthenticationProvider.php

示例12: supportsToken

 public function supportsToken(TokenInterface $token, $providerKey)
 {
     return $token instanceof PreAuthenticatedToken && $token->getProviderKey() === $providerKey || $token instanceof AnonymousToken;
 }
开发者ID:HenryTelecom,项目名称:wwwroot,代码行数:4,代码来源:SsoAuthenticator.php

示例13: isAdminToken

 /**
  * @param TokenInterface $token
  * @param                $providerKey
  *
  * @return bool
  */
 private function isAdminToken($providerKey, TokenInterface $token = null)
 {
     return is_callable([$token, 'getProviderKey']) && $token->getProviderKey() === $providerKey;
 }
开发者ID:bakie,项目名称:KunstmaanBundlesCMS,代码行数:10,代码来源:AdminLocaleListener.php

示例14: supports

 /**
  * Check whether this provider supports the given token.
  *
  * @param TokenInterface $token
  *
  * @return boolean
  */
 public function supports(TokenInterface $token)
 {
     return $token instanceof UsernamePasswordToken && $token->getProviderKey() === $this->providerKey && $this->emailValidator->isValid($token->getUsername()) && $this->imapManager->supports($token->getUsername());
 }
开发者ID:rejsmont,项目名称:LabDB,代码行数:11,代码来源:ImapAuthenticationProvider.php

示例15: supportsToken

 /**
  * @param TokenInterface $token
  * @param $providerKey
  * @return bool
  */
 public function supportsToken(TokenInterface $token, $providerKey)
 {
     return $token instanceof UsernamePasswordToken && $token->getProviderKey() === $providerKey;
 }
开发者ID:spolischook,项目名称:ylang-ylang,代码行数:9,代码来源:PamAuthenticator.php


注:本文中的Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getProviderKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。