I'm setting up the Android Management API with the Google API PHP Client but I figured that my authentication config I provided to the client has no impact when I'm sending a request.
I tested if the credentials file exists and if syntax errors inside the file are handled. I followed the error message link. I've searched the web several times, reached out to the documentation and the php doc inside the library but I couldn't figure it out.
$client = new \Google_Client();
$client->setApplicationName('SecretName');
$client->setAuthConfig(x::getRootDir() . '/modules/package-androidmanagement/credentials2.json');
$client->addScope(Google_Service_AndroidManagement::ANDROIDMANAGEMENT);
$am = new \Google_Service_AndroidManagement($client);
try {
$signupUrl = $am->signupUrls->create(['projectId' => $this->projectId, 'callbackUrl' => x::getDomain()]);
} catch (Exception $exception) {
echo $exception->getMessage();
}
Expected: signupUrl Object Actual: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.