/** * Deletes an authentication for an application based on the specified refresh token. * * @param string $refreshToken Alphanumeric string used for access tokens. This token refreshes access for accounts by generating a new developer or application account authentication ticket after an access token expires. */ public static function deleteAppAuthTicketClient($refreshToken) { $url = AuthTicketUrl::deleteAppAuthTicketUrl($refreshToken); $mozuClient = new MozuClient(); $mozuClient->withResourceUrl($url); return $mozuClient; }
private function refreshAuthTicket() { try { $requestData = new AuthTicketRequest(); $requestData->refreshToken = $this->authTicket->refreshToken; $client = new Client(['base_uri' => MozuConfig::$baseAppAuthUrl, 'verify' => false]); $headers = ["content-type" => "application/json"]; $body = json_encode($requestData); $promise = $client->requestAsync("PUT", AuthTicketUrl::RefreshAppAuthTicketUrl(null)->getUrl(), ['headers' => $headers, 'body' => $body, 'exceptions' => true]); $response = $promise->wait(); $jsonResp = $response->getBody(true); $this->authTicket = json_decode($jsonResp); $this->setRefreshInterval(true); } catch (\Exception $e) { HttpHelper::checkError($e); } }