2013-06-17 2 views
0

POST @https://apps-apis.google.com/a/feeds/domain/user/2.0을 통해 프로비저닝 API를 사용하여 '사용자 계정 만들기'작업을 호출 할 때 HTTP 403 오류가 발생했습니다. 수신 된 응답은 다음과 같습니다.Google Provisioning API 403 오류

"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "forbidden", 
    "message": "Forbidden" 
    } 
    ], 
    "code": 403, 
    "message": "Forbidden" 
} 
} 

지난 주말까지 API가 작동했습니다. 내 코드베이스에서 코드가 변경되지 않았습니다. API가 다운 되었습니까? The API docs does say the API has been deprecated. 그러나 API는 여전히 지원 중단 정책에 따라 작동해야합니다.

EDIT : Provisioning API가 Directory API로 대체 된 것 같습니다. 그리고 디렉토리의 API 전제 조건, 그것은

Note: The API device operations do not support remote administrative access for Google authorized resellers.

그는 구글 공식 리셀러에 액세스 할 수 없습니다 사용자를 만들기위한 API로 API?의 의미, 관리 액세스를 프로비저닝 같은 일을 의미 하는가 "라고?

답변

0

나는이 질문이 약간 구식 인 것을 알고있다. 그러나 대답이 없으면서 오늘 이것을 이해하려고 몇 시간을 보냈다. 내 대답이 앞으로 누군가를 도울 수있는 것 같다.

내 코드는 : 사용자의 계정 데이터 (username + password)로 로그인하려고했는데 다른 비밀번호를 만들었습니다. 관리자 권한으로 NT 업데이트를 진행하십시오.

내 경우에는이 솔루션은 다음과 같습니다

$domain = 'yourdomain.com'; 
$username = '...';  // the user you're trying to update 
$admin_username = '...'; // administrative credentials 
$admin_password = '...'; 


$config = array(
       'adapter' => 'Zend_Http_Client_Adapter_Proxy', 
       'proxy_host' => 'proxy.example.com', 
       'proxy_port' => '...'); // your proxy port here (ex: 8000) 

$proxiedHttpClient = new Zend_Gdata_HttpClient(
          'https://www.google.com:443', 
          $config); 

$client = Zend_Gdata_ClientLogin::getHttpClient(
       $admin_username, 
       $admin_password, 
       Zend_Gdata_Gapps::AUTH_SERVICE_NAME, 
       $proxiedHttpClient); 

$gdata = new Zend_Gdata_Gapps($client, $domain); 
$userEntry = $gdata->retrieveUser($username); 

// example: changing user's password 
$userEntry->getLogin()->setPassword('Top$EcreT_2014'); 


$gdata->updateUser($username, $userEntry);