|  | @@ 223-230 (lines=8) @@ | 
                                                            
                                    | 220 |  |     public function login() { | 
                                                            
                                    | 221 |  |         if (!empty($this->credentials)) { | 
                                                            
                                    | 222 |  |             $response = $this->oauth2Token()->execute($this->credentials)->getResponse(); | 
                                                            
                                    | 223 |  |             if ($response->getStatus() == '200') { | 
                                                            
                                    | 224 |  |                 $this->setToken($response->getBody(FALSE)); | 
                                                            
                                    | 225 |  |                 static::storeToken($this->token, $this->credentials['client_id']); | 
                                                            
                                    | 226 |  |                 return TRUE; | 
                                                            
                                    | 227 |  |             } else { | 
                                                            
                                    | 228 |  |                 $error = $response->getBody(); | 
                                                            
                                    | 229 |  |                 throw new AuthenticationException("Login Response [" . $error['error'] . "] " . $error['error_message']); | 
                                                            
                                    | 230 |  |             } | 
                                                            
                                    | 231 |  |         } | 
                                                            
                                    | 232 |  |         return FALSE; | 
                                                            
                                    | 233 |  |     } | 
                                                                                
                                |  | @@ 249-256 (lines=8) @@ | 
                                                            
                                    | 246 |  |                 'refresh_token' => $this->token->refresh_token | 
                                                            
                                    | 247 |  |             ); | 
                                                            
                                    | 248 |  |             $response = $this->oauth2Refresh()->execute($refreshOptions)->getResponse(); | 
                                                            
                                    | 249 |  |             if ($response->getStatus() == '200') { | 
                                                            
                                    | 250 |  |                 $this->setToken($response->getBody(FALSE)); | 
                                                            
                                    | 251 |  |                 static::storeToken($this->token, $this->credentials['client_id']); | 
                                                            
                                    | 252 |  |                 return TRUE; | 
                                                            
                                    | 253 |  |             } else { | 
                                                            
                                    | 254 |  |                 $error = $response->getBody(); | 
                                                            
                                    | 255 |  |                 throw new AuthenticationException("Refresh Response [" . $error['error'] . "] " . $error['error_message']); | 
                                                            
                                    | 256 |  |             } | 
                                                            
                                    | 257 |  |         } | 
                                                            
                                    | 258 |  |         return FALSE; | 
                                                            
                                    | 259 |  |     } | 
                                                                                
                                |  | @@ 268-275 (lines=8) @@ | 
                                                            
                                    | 265 |  |     public function logout(){ | 
                                                            
                                    | 266 |  |         if ($this->authenticated()){ | 
                                                            
                                    | 267 |  |             $response = $this->oauth2Logout()->execute()->getResponse(); | 
                                                            
                                    | 268 |  |             if ($response->getStatus()=='200'){ | 
                                                            
                                    | 269 |  |                 unset($this->token); | 
                                                            
                                    | 270 |  |                 static::removeStoredToken($this->credentials['client_id']); | 
                                                            
                                    | 271 |  |                 return TRUE; | 
                                                            
                                    | 272 |  |             }else{ | 
                                                            
                                    | 273 |  |                 $error = $response->getBody(); | 
                                                            
                                    | 274 |  |                 throw new AuthenticationException("Logout Response [".$error['error']."] ".$error['message']); | 
                                                            
                                    | 275 |  |             } | 
                                                            
                                    | 276 |  |         } | 
                                                            
                                    | 277 |  |         return FALSE; | 
                                                            
                                    | 278 |  |     } |