firebase / firebase/firebase-tools
Authentication Error Despite Correct Token - Proxy and SSL Certificate Prb.
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
We encountered the following error even though the token was correct:
```
.../step_2se4t5ss.ytl/eb0525e1-ebfb-48ab-835a-c48c6a9bfb7a.script:13:in `run_command': Command failed. Check logs for details (RuntimeError)
⚠ Authenticating with --token is deprecated and will be removed in a future major version of firebase-tools. Instead, use a service account key with GOOGLE_APPLICATION_CREDENTIALS: https://cloud.google.com/docs/authentication/getting-started
i uploading binary...
Error: failed to upload release. Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth
For CI servers and headless environments, generate a new token with firebase login:ci
⚠ Unable to fetch the CLI MOTD and remote config.
```
However, the actual cause of the error was as follows:
We are using a proxy, and the proxy is intercepting the Firebase CLI requests by performing HTTPS inception. Meanwhile, the SSL certificate being used is self-signed, causing Firebase to encounter an SSL certificate error.
Firebase is reporting an authentication error despite the token being correct, but it should be reporting a self-signed certificate error.
To resolve this issue, it is necessary to add the `NODE_EXTRA_CA_CERTS` environment variable.
**Steps to Reproduce:**
1. Use a proxy that intercepts HTTPS requests.
2. Use a self-signed SSL certificate.
3. Authenticate with Firebase using a correct token.
4. Observe that Firebase reports an authentication error instead of a self-signed certificate error.
**Expected Behavior:**
Firebase should correctly report a self-signed certificate error when an SSL certificate issue is encountered.
**Actual Behavior:**
Firebase incorrectly reports an authentication error when an SSL certificate issue is encountered.
**Additional Information:**
Adding the `NODE_EXTRA_CA_CERTS` environment variable is a necessary step to address this issue.
Contributor guide
Assessment
This issue has not been assessed yet.