I have aws sdk php cognito to refresh token,
public function refreshToken($username, $refreshToken) { try { $response = $this->clie