kreait / firebase-php

Unofficial Firebase Admin SDK for PHP
https://firebase-php.readthedocs.io/
MIT License
2.27k stars 431 forks source link

Your client does not have permission to get URL /v1/accounts:signUp from this server #765

Closed aschurf closed 1 year ago

aschurf commented 1 year ago

Describe the bug

An attempt to create a user fails "Your client does not have permission to get URL /v1/accounts:signUp from this server"

Your client does not have permission to get URL /v1/accounts:signUp from this server. That’s all we know. Previously, everything worked fine, users were created, but now it does not work. I also tried creating a new service account in the firebase console, but that didn't help. ### Installed packages ```json { "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "php": "^8.0.2", "ext-curl": "*", "ext-dom": "*", "ext-gd": "*", "ext-simplexml": "*", "amocrm/amocrm-api-library": "^0.12.0", "barryvdh/laravel-dompdf": "^1.0", "dompdf/dompdf": "^1.2", "guzzlehttp/guzzle": "^7.2", "hflabs/dadata": "^22.3", "kreait/firebase-php": "^7.0", "laravel/framework": "^9.11", "laravel/sanctum": "^2.14.1", "laravel/socialite": "^5.5", "laravel/tinker": "^2.7", "laravel/ui": "^3.4", "mpdf/mpdf": "^8.1", "phpoffice/phpspreadsheet": "^1.23", "spatie/laravel-image-optimizer": "^1.7", "symfony/http-client": "^6.1", "symfony/mailgun-mailer": "^6.1" }, "require-dev": { "fakerphp/faker": "^1.9.1", "laravel/breeze": "^1.9", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.1", "phpunit/phpunit": "^9.5.10", "spatie/laravel-ignition": "^1.0" }, "autoload": { "psr-4": { "App\\": "app/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-update-cmd": [ "@php artisan vendor:publish --tag=laravel-assets --ansi --force" ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] }, "extra": { "laravel": { "dont-discover": [] } }, "config": { "platform": { "php": "8.1.6" }, "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, "platform-check": false }, "minimum-stability": "dev", "prefer-stable": true } ``` ### PHP version and extensions ```shell php 7.4.3 ``` ### Steps to reproduce the issue. ```shell # Insert the commands issued in the terminal if they are needed # to reproduce the issue. Otherwise, delete this code block. ``` ```php $factory = (new Factory)->withServiceAccount('path/to/serviceAccount.json'); $auth = $factory->createAuth(); $userProperties = [ 'email' => "test@gmail.ru", 'emailVerified' => false, 'password' => "password", 'displayName' => "Test", 'disabled' => false ]; try { $createdUser = $auth->createUser($userProperties); } catch (AuthException $e) { dd($e->getMessage()); //Your client does not have permission to get URL /v1/accounts:signUp from this server. That’s all we know. } ``` ### Error message/Stack trace ```shell Your client does not have permission to get URL /v1/accounts:signUp from this server. That’s all we know. ``` ### Additional information _No response_

jeromegamez commented 1 year ago

Unfortunately, as this is an API response from Firebase, it cannot be handled from within the SDK. If it worked before and now not anymore, it's an additional sign that it's not something within the SDK.

A possible reason could be that the IP address you run the code on is deny-listed by Google's Servers, or that an API has been accidentally disabled (you can check at, for example, https://console.cloud.google.com/apis/library/browse?q=identity%20and%20access%20management%20(iam)%20api). But that's just a guess from the top of my head, and I'm sure you have already looked into this.

If the problem persists (I couldn't reproduce it on my machine), it might be worth asking on StackOverflow or raising a ticket at Google/Firebase directly (this is not an official Admin SDK).

If you're working for a company, you might consider becoming a Sponsor in one of the Firebase xxx Sponsor tiers, then we can look into it together.

Aside from that:

I'm going to close the issue now because it doesn't seem to be a bug in the SDK. Feel free to share your findings in further comments so that others can benefit from them 🤞🏻