You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Enable authentication when a non-default api_endpoint is set (just like the googleapis/nodejs-storage) #895
Issue we're facing:
After version 2.1.0, authorization bearer token is stopped being sent to the custom endpoints (non-default api_endpoint), we forcefully needed to downgrade to the version 2.0.0 to make things work on our end. We had other option like explicitly passing credentials while instantiating the storage client, but this change was needed to be done in all places wherever the client is instantiated, so we just went to downgrade to the version 2.0.0.
Feature request:
Since this change feat: avoid authentication with storage emulator was intentional, can you please add a flag to enable the auth for custom endpoints something like in the googleapis/nodejs-storage?
Hi @MadhuPolu thanks for filing this issue. Could you please describe your use case in more detail?
If I understand correctly, the desire is for the client to detect the default credentials for the current environment while using a non-default api_endpoint, instead of explicitly passing in credentials. Is my understanding correct? The current design will not bypass auth if you pass in credentials when instantiating a client.
Yes @cojenco, you're correct, we need the client to detect the default credentials while using a non-default api_endpoint. And we don't want to pass any credentials explicitly when instantiating a client as we heavily depend on ADC (Application Default Credentials).
Please let me know if you need any more details.
Trivials:
We also use other language GCS clients Go, Node.js, Java, PHP. All are supporting the ADC out of the box when the non-default api_endpoint is set, Node.js enabled it through a flag.
One year ago, we faced the similar problem with googleapis/nodejs-storage, here is the nodejs-storage bug we reported.
ADC is a strategy used by Cloud Client Libraries and Google API Client Libraries to automatically find credentials based on the application environment, and use those credentials to authenticate to Google Cloud APIs.
Activity
cojenco commentedon Nov 8, 2022
Hi @MadhuPolu thanks for filing this issue. Could you please describe your use case in more detail?
If I understand correctly, the desire is for the client to detect the default credentials for the current environment while using a non-default api_endpoint, instead of explicitly passing in credentials. Is my understanding correct? The current design will not bypass auth if you pass in credentials when instantiating a client.
MadhuPolu commentedon Nov 8, 2022
Yes @cojenco, you're correct, we need the client to detect the default credentials while using a non-default api_endpoint. And we don't want to pass any credentials explicitly when instantiating a client as we heavily depend on ADC (Application Default Credentials).
Please let me know if you need any more details.
Trivials:
ADC is a strategy used by Cloud Client Libraries and Google API Client Libraries to automatically find credentials based on the application environment, and use those credentials to authenticate to Google Cloud APIs.
cojenco commentedon Nov 10, 2022
Thank you for the additional context👍 I'm working with our team to address this.
cojenco commentedon Dec 7, 2022
Hi @MadhuPolu the fix is now ready in v2.7.0 Thanks again for reporting!