我似乎不能罚款一个更新的教程从.p12文件从控制台。
$client = new Google_Client();
$client->setApplicationName("XXXXXXXX");
$client->setAssertionCredentials(
new \Google_Auth_AssertionCredentials(
'xxxxxxxxxx@developer.gserviceaccount.com',
array('https://www.googleapis.com/auth/analytics.readonly'),
file_get_contents(app_path()."\config\analytics\client_secret_xxxxxxxxxxxxx.apps.googleusercontent.com.json")
)
);
$client->setClientId('xxxxxx.apps.googleusercontent.com');
$client->setAccessType('offline_access');
$service = new Google_Service_Analytics($client);我得到了这个错误
Unable to parse the p12 file. Is this a .p12 file? Is the password correct? OpenSSL error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag我在存储库上使用api的最新版本。im试图解析的文件是在开发人员控制台下载的文件: Apis & Auth、->凭据、->下载JSON。在创建新的Cliend Id之后。我不能罚款如果.p12文件可以下载或如果它仍然需要。
发布于 2015-01-19 23:14:12
您需要创建一个Service Account,而不是Web Application或Installed Application。一旦创建了这样一个客户机,就可以使用一个名为“GeneratenewP12 key”的按钮来生成和下载.p12文件。
https://stackoverflow.com/questions/28034518
复制相似问题