【发布时间】:2013-01-09 08:11:08
【问题描述】:
我们已通过 Google 应用市场发布了应用。我们需要在他们通过 API 安装我们的应用程序的域上创建用户。我绑定了以下 php 代码,但是我收到 401 错误。请帮忙。
$oauthOptions = array(
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
'version' => '2.0', 'scope' => '',
'signatureMethod' => "HMAC-SHA1",
'consumerKey' => 'marketplace oauth consumer key',
'consumerSecret' => 'marketplace oauth consumer secret key' );
$consumer = new Zend_Oauth_Consumer($oauthOptions);
$token = new Zend_Oauth_Token_Access();
$token->setToken('');
$token->setTokenSecret('');
$client = $token->getHttpClient($oauthOptions);
$gdata = new Zend_Gdata_Gapps($client, 'domain name');
$gdata->createUser('user34', 'fistname', 'familyname', 'Password');
【问题讨论】:
-
对于身份验证,你看过examples吗?请注意,您应该转而在标准流程或“服务帐户”流程中使用 OAuth2。详情请参阅documentation。
标签: google-apps-marketplace google-provisioning-api createuser