Getting “Unable to parse the p12 file…” Error With google-api-php-client

前端 未结 6 1905
忘了有多久
忘了有多久 2020-12-20 15:02

I\'ve been searching for days and trying new and older version of google-api-php-client along with various other examples out there, but I can\'t seem to get around this err

6条回答
  •  悲&欢浪女
    2020-12-20 15:16

    I'm pretty sure you need to write the phrase 'notasecret' somewhere in this section of code:

    $key = file_get_contents($key_file_location);
    $cred = new Google_Auth_AssertionCredentials(
        $service_account_name,
        array('https://www.googleapis.com/auth/books'),
        $key
    );
    

    'Where?', is the question...

    This looks like it has the correct code: https://github.com/google/google-api-php-client/blob/master/src/Google/Auth/AssertionCredentials.php

    I will update my answer to confirm this works once I have tested it.

    :)

提交回复
热议问题