PHP Class Elcodi\Store\ConnectBundle\Services\OAuthUserProvider

Author: Berny Cantos ([email protected])
Inheritance: implements HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface
Mostrar archivo Open project: elcodi/bamboo

Public Methods

Method Description
__construct ( Symfony\Component\Security\Core\User\UserProviderInterface $userProvider, Elcodi\Component\Core\Services\ObjectDirector $authorizationDirector, Elcodi\Component\Core\Services\ObjectDirector $customerDirector, Doctrine\Common\Persistence\ObjectManager $authorizationObjectManager, Elcodi\Component\User\EventDispatcher\Interfaces\UserEventDispatcherInterface $userEventDispatcher ) Constructor
loadUserByOAuthUserResponse ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface Loads the user by a given UserResponseInterface object.

Protected Methods

Method Description
createAuthorization ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response, Symfony\Component\Security\Core\User\UserInterface $user ) : Authorization Creates an authorization for a given user
createUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface Create a new user from a response
findAuthorization ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization | null Checks if a valid authorization exists for a given user
findOrCreateUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface Find or creates a user related to a given response of the resource owner
findUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface | null Find the user related to the response of the resource owner
getExpirationDate ( integer $secondsToExpiration ) : DateTime Return expiration date given time to expiration
save ( Authorization $authorization ) Persist an authorization
updateAuthorization ( Authorization $authorization, HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization Updates an existing authorization with data from the resource owner

Method Details

__construct() public method

Constructor
public __construct ( Symfony\Component\Security\Core\User\UserProviderInterface $userProvider, Elcodi\Component\Core\Services\ObjectDirector $authorizationDirector, Elcodi\Component\Core\Services\ObjectDirector $customerDirector, Doctrine\Common\Persistence\ObjectManager $authorizationObjectManager, Elcodi\Component\User\EventDispatcher\Interfaces\UserEventDispatcherInterface $userEventDispatcher )
$userProvider Symfony\Component\Security\Core\User\UserProviderInterface Where to search for valid users
$authorizationDirector Elcodi\Component\Core\Services\ObjectDirector Authorization Director
$customerDirector Elcodi\Component\Core\Services\ObjectDirector Customer Director
$authorizationObjectManager Doctrine\Common\Persistence\ObjectManager Customer Object Manager
$userEventDispatcher Elcodi\Component\User\EventDispatcher\Interfaces\UserEventDispatcherInterface User event dispatcher

createAuthorization() protected method

Creates an authorization for a given user
protected createAuthorization ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response, Symfony\Component\Security\Core\User\UserInterface $user ) : Authorization
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the resource owner
$user Symfony\Component\Security\Core\User\UserInterface User
return Elcodi\Store\ConnectBundle\Entity\Authorization

createUser() protected method

Create a new user from a response
protected createUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface

findAuthorization() protected method

Checks if a valid authorization exists for a given user
protected findAuthorization ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization | null
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the ResourceOwner
return Elcodi\Store\ConnectBundle\Entity\Authorization | null

findOrCreateUser() protected method

Find or creates a user related to a given response of the resource owner
protected findOrCreateUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the resource owner
return Symfony\Component\Security\Core\User\UserInterface

findUser() protected method

Find the user related to the response of the resource owner
protected findUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface | null
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface | null

getExpirationDate() protected method

Return expiration date given time to expiration
protected getExpirationDate ( integer $secondsToExpiration ) : DateTime
$secondsToExpiration integer
return DateTime

loadUserByOAuthUserResponse() public method

Loads the user by a given UserResponseInterface object.
public loadUserByOAuthUserResponse ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface

save() protected method

Persist an authorization
protected save ( Authorization $authorization )
$authorization Elcodi\Store\ConnectBundle\Entity\Authorization Authorization to persist

updateAuthorization() protected method

Updates an existing authorization with data from the resource owner
protected updateAuthorization ( Authorization $authorization, HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization
$authorization Elcodi\Store\ConnectBundle\Entity\Authorization Authorization
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the resource owner
return Elcodi\Store\ConnectBundle\Entity\Authorization