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


PHP UserProviderInterface::getProviders方法代码示例

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


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

示例1: authenticate

 /**
  * Attempts to authenticate a TokenInterface object.
  *
  * @param TokenInterface $token The TokenInterface instance to authenticate
  *
  * @return TokenInterface An authenticated TokenInterface instance, never null
  *
  * @throws AuthenticationException if the authentication fails
  */
 public function authenticate(TokenInterface $token)
 {
     if ($this->userProvider instanceof ChainUserProvider) {
         foreach ($this->userProvider->getProviders() as $provider) {
             $result = $this->doAuth($provider, $token);
             if ($result !== false) {
                 return $result;
             }
         }
     } else {
         $result = $this->doAuth($this->userProvider, $token);
         if ($result !== false) {
             return $result;
         }
     }
 }
开发者ID:RedDevilHat,项目名称:symfony2,代码行数:25,代码来源:ApiKeyProvider.php

示例2: __construct

 /**
  * @param                       $user
  * @param TokenInterface        $token
  * @param UserProviderInterface $userProvider
  * @param Request               $request
  * @param bool                  $loginCheck            Event executed from the mautic_sso_login_check route typically used as the SSO callback
  * @param string                $authenticatingService Service Service requesting authentication
  * @param null                  $integrations
  */
 public function __construct($user, TokenInterface $token, UserProviderInterface $userProvider, Request $request, $loginCheck = false, $authenticatingService = null, $integrations = null)
 {
     $this->token = $token;
     $this->user = $user;
     $this->isFormLogin = $token instanceof UsernamePasswordToken;
     $this->integrations = $integrations;
     $this->request = $request;
     $this->isLoginCheck = $loginCheck;
     $this->authenticatingService = $authenticatingService;
     if ($userProvider instanceof ChainUserProvider) {
         // Chain of user providers so let's find Mautic's
         $providers = $userProvider->getProviders();
         foreach ($providers as $provider) {
             if ($provider instanceof UserProvider) {
                 $userProvider = $provider;
                 break;
             }
         }
     }
     $this->userProvider = $userProvider;
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:30,代码来源:AuthenticationEvent.php


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