PHP Class WellCommerce\Bundle\OAuthBundle\Security\FacebookAuthenticator

Inheritance: extends Symfony\Component\Security\Guard\AbstractGuardAuthenticator
ファイルを表示 Open project: wellcommerce/wellcommerce

Protected Properties

Property Type Description
$appId string
$appSecret string
$clientManager WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface
$facebookProvider League\OAuth2\Client\Provider\Facebook
$routerHelper WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface

Public Methods

Method Description
__construct ( WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface $clientManager, WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface $routerHelper, string $appId, string $appSecret ) FacebookAuthenticator constructor.
checkCredentials ( $credentials, Symfony\Component\Security\Core\User\UserInterface $user )
createAuthenticatedToken ( Symfony\Component\Security\Core\User\UserInterface $user, string $providerKey ) : UsernamePasswordToken
getCredentials ( Request $request )
getProvider ( ) : League\OAuth2\Client\Provider\Facebook
getUser ( $authorizationCode, Symfony\Component\Security\Core\User\UserProviderInterface $userProvider )
onAuthenticationFailure ( Request $request, Symfony\Component\Security\Core\Exception\AuthenticationException $exception ) : RedirectResponse Scheme used after authentification fails
onAuthenticationSuccess ( Request $request, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, string $providerKey ) : RedirectResponse Scheme used after authentification succeeds
start ( Request $request, Symfony\Component\Security\Core\Exception\AuthenticationException $authException = null ) : RedirectResponse Starts the authentication scheme.
supportsRememberMe ( ) : boolean

Protected Methods

Method Description
autoRegisterClient ( League\OAuth2\Client\Provider\FacebookUser $facebookUser ) : WellCommerce\Bundle\ClientBundle\Entity\ClientInterface Automatic register process

Method Details

__construct() public method

FacebookAuthenticator constructor.
public __construct ( WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface $clientManager, WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface $routerHelper, string $appId, string $appSecret )
$clientManager WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface
$routerHelper WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface
$appId string
$appSecret string

autoRegisterClient() protected method

Automatic register process
protected autoRegisterClient ( League\OAuth2\Client\Provider\FacebookUser $facebookUser ) : WellCommerce\Bundle\ClientBundle\Entity\ClientInterface
$facebookUser League\OAuth2\Client\Provider\FacebookUser
return WellCommerce\Bundle\ClientBundle\Entity\ClientInterface

checkCredentials() public method

public checkCredentials ( $credentials, Symfony\Component\Security\Core\User\UserInterface $user )
$user Symfony\Component\Security\Core\User\UserInterface

createAuthenticatedToken() public method

public createAuthenticatedToken ( Symfony\Component\Security\Core\User\UserInterface $user, string $providerKey ) : UsernamePasswordToken
$user Symfony\Component\Security\Core\User\UserInterface
$providerKey string
return Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken

getCredentials() public method

public getCredentials ( Request $request )
$request Symfony\Component\HttpFoundation\Request

getProvider() public method

public getProvider ( ) : League\OAuth2\Client\Provider\Facebook
return League\OAuth2\Client\Provider\Facebook

getUser() public method

public getUser ( $authorizationCode, Symfony\Component\Security\Core\User\UserProviderInterface $userProvider )
$userProvider Symfony\Component\Security\Core\User\UserProviderInterface

onAuthenticationFailure() public method

Scheme used after authentification fails
public onAuthenticationFailure ( Request $request, Symfony\Component\Security\Core\Exception\AuthenticationException $exception ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$exception Symfony\Component\Security\Core\Exception\AuthenticationException
return Symfony\Component\HttpFoundation\RedirectResponse

onAuthenticationSuccess() public method

Scheme used after authentification succeeds
public onAuthenticationSuccess ( Request $request, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, string $providerKey ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
$providerKey string
return Symfony\Component\HttpFoundation\RedirectResponse

start() public method

Starts the authentication scheme.
public start ( Request $request, Symfony\Component\Security\Core\Exception\AuthenticationException $authException = null ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$authException Symfony\Component\Security\Core\Exception\AuthenticationException
return Symfony\Component\HttpFoundation\RedirectResponse

supportsRememberMe() public method

public supportsRememberMe ( ) : boolean
return boolean

Property Details

$appId protected_oe property

protected string $appId
return string

$appSecret protected_oe property

protected string $appSecret
return string

$clientManager protected_oe property

protected ManagerInterface,WellCommerce\Bundle\DoctrineBundle\Manager $clientManager
return WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface

$facebookProvider protected_oe property

protected Facebook,League\OAuth2\Client\Provider $facebookProvider
return League\OAuth2\Client\Provider\Facebook

$routerHelper protected_oe property

protected RouterHelperInterface,WellCommerce\Bundle\CoreBundle\Helper\Router $routerHelper
return WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface