为什么我的新版Google服务帐户无法使用?

时间:2019-09-15 18:48:36

标签: service account

不太擅长编码,但是在您的专业人士的帮助下,我大多数时候都可以使它工作,我需要帮助。

我有一个应用程序,可以使人们轻松地在Google日历上安排活动。每个用户都有一个单独的应用程序实例。我几年前设置的用户现在仍可以发布到Google日历,但是我最近设置的用户不能。它为他们工作,然后停止。

我查看了我的config.php文件,我发现与工作中的人和没有工作的人之间的唯一区别是,现在Google服务帐户中的区别有所不同...

服务帐户拥有者可以使用... compute@developer.gserviceaccount.com

新的服务帐户拥有此帐户,因此不起作用... .iam.gserviceaccount.com

例如,这是config.php文件不起作用...

    <?php 
    if ( version_compare(PHP_VERSION, '5.3.0', '<') )
    {           echo 'Gcal - Add Gcal Events requires at least PHP 5.3';
        die();
    }
    if ( false && memory_get_usage() < 31000000 )
    {           
        echo 'Gcal - Add Gcal Events requires at least 32 MByte Server 
    RAM. Please increase it';
        die();
    }
    if ( !function_exists('curl_init') )
    {           
        echo 'Gcal - Add Gcal Events requires the CURL PHP extension';
        die();
    }
    if ( !function_exists('json_decode') )
    {           
        echo 'Gcal - Add Gcal Events requires the JSON PHP extension';
        die();
    }
    if ( !function_exists('http_build_query') )
    {           
        echo 'Gcal - Add Gcal Events requires http_build_query()';
        die();
    }
    //error_reporting(0);
    if(!defined('DB_SERVER')) define('DB_SERVER','localhost'); /* Databse 
    server name */
    if(!defined('DB_NAME')) 
    define('DB_NAME','michaell_ns_bulat2');/*Database name*/
    if(!defined('DB_USER')) define('DB_USER','michaell_ns');/* Database 
    username*/
    if(!defined('DB_PASSWORD')) 
    define('DB_PASSWORD','nextstep');/*Database password*/
    if(!defined('EVENT_ROOT')) 
    define('EVENT_ROOT',dirname(__FILE__));/*Root Directory Path*/
    if(!defined('DS')) define('DS','/');/*Directory separator*/
    if(!defined('TBL_EVENTS')) define('TBL_EVENTS','gcal_events');/*evets 
    table name*/
    if(!defined('TBL_EVENT_TITLE')) 
    define('TBL_EVENT_TITLE','gcal_event_titles');/*Event title name*/
    if(!defined('TBL_EVENT_LOCATION')) 
    define('TBL_EVENT_LOCATION','gcal_event_location');/*location table*/
    if(!defined('TBL_ADMINUSER')) 
    define('TBL_ADMINUSER','gcal_adminuser');/*Admin Usertable name*/


    /*Google Calender client API settings.*/
    if(!defined('CLIENT_ID')) define('CLIENT_ID','618475012213- 
   2ji2iogltgh4b5qdkokaqkmrofekfr30.apps.googleusercontent.com');/*Gcal- 
   Event-27ae05c52938*/
    if(!defined('SERVICE_ACCOUNT')) 
    define('SERVICE_ACCOUNT','nextstep@orbital-cistern- 
   198819.iam.gserviceaccount.com');/*Service account email address here, 
    e.g. eventdemo@testevent-146912.iam.gserviceaccount.com*/
    if(!defined('KEY_FILE_NAME')) define('KEY_FILE_NAME','My Project 
    30914-e83a30aa42d1');/*file name here without extention, e.g. 
    testevent-19059dde4ebb*/
    if(!defined('APPLICATION_NAME')) define('APPLICATION_NAME','API Key 
    1');/*Root Directory Path*/


    global $connection;
    $connection = mysqli_connect(DB_SERVER,DB_USER,DB_PASSWORD,DB_NAME);
    if (!$connection) {
        die('Connect Error: ' . mysqli_connect_error());
    }
    ?>

0 个答案:

没有答案