0

I cant seem to fined an updated tutorial for getting the .p12 file from the Google Developer Console.

$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);

Im getting this error

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

Im using the latest version of the api at repository. The file im trying to parce is the one downloaded in the developer console under: Apis & Auth -> credentials -> Download JSON. Right after creating a new Cliend Id. I cant fined were the .p12 file can be downloaded or if it still necessary.

4

1 に答える 1

2

またはではService Accountないを作成する必要があります。このようなクライアントを作成すると、.p12 ファイルの生成とダウンロードに使用できる [新しい P12 キーの生成] というボタンが表示されます。Web ApplicationInstalled Application

于 2015-01-19T23:14:12.937 に答える