protected static function _configureOAuthService() { if (APIRequest::hasOAuthService()) { return; } $authModule = new \OAuth\UserlessAuthorizationModule(new \OAuth\JSONTokenResponseParser(), new \OAuth\GoogleJWTRequestBuilder(GOOGLE_MYBUSINESS_API_AUTH_EMAIL, GOOGLE_MYBUSINESS_API_AUTH_TARGET, GOOGLE_MYBUSINESS_API_AUTH_SCOPE, GOOGLE_MYBUSINESS_API_AUTH_KEYFILE, GOOGLE_MYBUSINESS_API_AUTH_KEYFILE_PASSWORD, GOOGLE_MYBUSINESS_API_AUTH_OWNER), GOOGLE_MYBUSINESS_API_AUTH_TARGET); $authModule->usePostToAuthorize(); APIRequest::registerOAuthService(new \OAuth\Service($authModule)); }