public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null)
    {
        // Get Client Entity
        $client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
        if (!$client) {
            return null;
        }

        // Create Refresh Token
        $refreshToken = new \OAuth2\ServerBundle\Entity\RefreshToken();
        $refreshToken->setToken($refresh_token);
        $refreshToken->setClient($client);
        $refreshToken->setUserId($user_id);
        $refreshToken->setExpires($expires);
        $refreshToken->setScope($scope);

        // Store Refresh Token
        $this->em->persist($refreshToken);
        $this->em->flush();
    }
public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null)
    {
        // Get Client Entity
        $client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
        if (!$client) {
            return null;
        }

        // Create Refresh Token
        $refreshToken = new \OAuth2\ServerBundle\Entity\RefreshToken();
        $refreshToken->setToken($refresh_token);
        $refreshToken->setClient($client);
        $refreshToken->setUserId($user_id);
        $refreshToken->setExpires($expires);
        $refreshToken->setScope($scope);

        // Store Refresh Token
        $this->em->persist($refreshToken);
        $this->em->flush();
    }
public function setRefreshToken ( $ refresh_token , $ client_id , $ user_id , $ expires , $ scope = null ) { // Get Client Entity $ client = $ this -> em -> getRepository ( 'OAuth2ServerBundle:Client' ) -> find ( $ client_id ) ; if ( ! $ client ) { return null ; } // Create Refresh Token $ refreshToken = new \ OAuth2 \ ServerBundle \ Entity \ RefreshToken ( ) ; $ refreshToken -> setToken ( $ refresh_token ) ; $ refreshToken -> setClient ( $ client ) ; $ refreshToken -> setUserId ( $ user_id ) ; $ refreshToken -> setExpires ( $ expires ) ; $ refreshToken -> setScope ( $ scope ) ; // Store Refresh Token $ this -> em -> persist ( $ refreshToken ) ; $ this -> em -> flush ( ) ; }
Take the provided refresh token values and store them somewhere.

This function should be the storage counterpart to getRefreshToken().

If storage fails for some reason, we're not currently checking for
any sort of success/failure, so you should bail out of the script
and provide a descriptive fail message.

Required for OAuth2::GRANT_TYPE_REFRESH_TOKEN.

@param $refresh_token
Refresh token to be stored.
@param $client_id
Client identifier to be stored.
@param $user_id
User identifier to be stored.
@param $expires
expires to be stored.
@param $scope
(optional) Scopes to be stored in space-separated string.

@ingroup oauth2_section_6
Take the provided refresh token values and store them somewhere .