public function getTokenAndUser()
    {
        $adapter = $this->getAdapter();

        $isOAuth2 = $this->version === self::OAUTH_VERSION_2;
        $token = $adapter->getAccessToken($this->provider);
        $user = $this->provider->getUser($token);

        return [
            'adapterKey' => $this->provider->getProviderName(),
            'token' => $token->getTokenValue(),
            'version' => $token->getTokenVersion(),
            'scope' => $isOAuth2 ? $token->getScope() : null,
            'refreshToken' => $isOAuth2 ? $token->getRefreshToken() : null,
            'expireTime' => $isOAuth2 ? gmdate('Y-m-d H:i:s', $token->getExpireTimestamp()) : null,
            'remoteUserId' => $user->getId(),
            'remoteUserName' => $user->getName(),
            'remoteEmail' => $user->getEmail(),
            'remoteImageUrl' => $user->getAvatar(),
            'remoteExtra' => json_encode($user->getExtra()),
        ];
    }
public function getTokenAndUser()
    {
        $adapter = $this->getAdapter();

        $isOAuth2 = $this->version === self::OAUTH_VERSION_2;
        $token = $adapter->getAccessToken($this->provider);
        $user = $this->provider->getUser($token);

        return [
            'adapterKey' => $this->provider->getProviderName(),
            'token' => $token->getTokenValue(),
            'version' => $token->getTokenVersion(),
            'scope' => $isOAuth2 ? $token->getScope() : null,
            'refreshToken' => $isOAuth2 ? $token->getRefreshToken() : null,
            'expireTime' => $isOAuth2 ? gmdate('Y-m-d H:i:s', $token->getExpireTimestamp()) : null,
            'remoteUserId' => $user->getId(),
            'remoteUserName' => $user->getName(),
            'remoteEmail' => $user->getEmail(),
            'remoteImageUrl' => $user->getAvatar(),
            'remoteExtra' => json_encode($user->getExtra()),
        ];
    }
public function getTokenAndUser ( ) { $ adapter = $ this -> getAdapter ( ) ; $ isOAuth2 = $ this -> version === self :: OAUTH_VERSION_2 ; $ token = $ adapter -> getAccessToken ( $ this -> provider ) ; $ user = $ this -> provider -> getUser ( $ token ) ; return [ 'adapterKey' => $ this -> provider -> getProviderName ( ) , 'token' => $ token -> getTokenValue ( ) , 'version' => $ token -> getTokenVersion ( ) , 'scope' => $ isOAuth2 ? $ token -> getScope ( ) : null , 'refreshToken' => $ isOAuth2 ? $ token -> getRefreshToken ( ) : null , 'expireTime' => $ isOAuth2 ? gmdate ( 'Y-m-d H:i:s' , $ token -> getExpireTimestamp ( ) ) : null , 'remoteUserId' => $ user -> getId ( ) , 'remoteUserName' => $ user -> getName ( ) , 'remoteEmail' => $ user -> getEmail ( ) , 'remoteImageUrl' => $ user -> getAvatar ( ) , 'remoteExtra' => json_encode ( $ user -> getExtra ( ) ) , ] ; }
To compatible with old version
@return array
To compatible with old version