2015-01-19 1 views
0

Google Developer Console에서 .p12 파일을 가져 오기위한 업데이트 된 자습서를 제출할 수 없습니다.Google Analytics보고 Api "p12 파일을 구문 분석 할 수 없습니다 .p12 파일입니까?"

$client = new Google_Client(); 
$client->setApplicationName("XXXXXXXX"); 
$client->setAssertionCredentials(
     new \Google_Auth_AssertionCredentials(
       '[email protected]', 
       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); 

은 임 repository에서 최신 버전의 API를 사용하여이 오류

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 

에게 임을 받고. parse하려고하는 파일은 개발자 콘솔의 Apis & Auth -> credentials -> JSON 다운로드에서 다운로드 한 파일입니다. 새로운 Cliend ID를 만든 직후입니다. .p12 파일을 다운로드 할 수 있거나 필요한 경우 벌금을 부과 할 수 없습니다.

답변

2

Web Application 또는 Installed Application이 아닌 Service Account을 만들어야합니다. 그런 클라이언트를 만들면 .p12 파일을 생성하고 다운로드하는 데 사용할 수있는 "새 P12 키 생성"버튼이 있습니다.