當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。