/** * Generates a new user authentication ticket for the specified tenant by supplying the user's existing refresh token information. * * @param string $responseFields Use this field to include those fields which are not included by default. * @param int $tenantId * @param TenantAdminUserAuthTicket $existingAuthTicket Properties of the authentication ticket to be used in user claims with the Mozu API. * @return MozuClient */ public static function refreshAuthTicketClient($existingAuthTicket, $tenantId = null, $responseFields = null) { $url = TenantAdminUserAuthTicketUrl::refreshAuthTicketUrl($responseFields, $tenantId); $mozuClient = new MozuClient(); $mozuClient->withResourceUrl($url)->withBody($existingAuthTicket); return $mozuClient; }
private static function getResourceRefreshUrl(UserAuthTicket $authTicket, $id = null) { switch ($authTicket->authenticationScope) { case AuthenticationScope::TENANT: return TenantAdminUserAuthTicketUrl::refreshAuthTicketUrl($id, null)->getUrl(); case AuthenticationScope::DEVELOEPR: return DeveloperAdminUserAuthTicketUrl::refreshDeveloperAuthTicketUrl($id, null)->getUrl(); default: throw new \Exception("Not Implemented"); } }