/**
  * Creates an authentication ticket for the supplied user to specify in API requests associated with the supplied tenant.
  *
  * @param string $responseFields Use this field to include those fields which are not included by default.
  * @param int $tenantId Unique identifier of the development or production tenant for which to generate the user authentication ticket.
  * @param UserAuthInfo $userAuthInfo Information required to authenticate a user.
  * @return MozuClient
  */
 public static function createUserAuthTicketClient($userAuthInfo, $tenantId = null, $responseFields = null)
 {
     $url = TenantAdminUserAuthTicketUrl::createUserAuthTicketUrl($responseFields, $tenantId);
     $mozuClient = new MozuClient();
     $mozuClient->withResourceUrl($url)->withBody($userAuthInfo);
     return $mozuClient;
 }
Пример #2
0
 private static function getResourceUrl($scope, $id = null)
 {
     switch ($scope) {
         case AuthenticationScope::TENANT:
             return TenantAdminUserAuthTicketUrl::createUserAuthTicketUrl($id, null)->getUrl();
         case AuthenticationScope::DEVELOEPR:
             return DeveloperAdminUserAuthTicketUrl::createDeveloperUserAuthTicketUrl($id, null)->getUrl();
         default:
             throw new \Exception("Not Implemented");
     }
 }