Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use credentials for authentication #44

Open
burhancoulibaly opened this issue Aug 1, 2019 · 1 comment
Open

Can't use credentials for authentication #44

burhancoulibaly opened this issue Aug 1, 2019 · 1 comment

Comments

@burhancoulibaly
Copy link

This module doesn't except credentials for authentication only keyfilename this can be fixed by adding

options.credentials = options.credentials || process.env.GCS_Credentials || null; on line 23

and
if(options.keyFilename != null){
try{
this.gcStorage = new Storage({
projectId: options.projectId,
credentials: options.keyFilename
});
}catch(error){
console.log(error);
}
}else if(options.credentials != null){
try{
this.gcStorage = new Storage({
projectId: options.projectId,
credentials: options.credentials
});
}catch(error){
console.log(error);
}
} or something similar to this starting on line 37

I ran into this issue trying to host an app on Heroku. Without this added if the user inputs google credentials (client_email, and private_key) and not the keyfilename the google-auth-library module looks to the environment to get GOOGLE_APPLICATION_CREDENTIALS and returns an error saying that the it was unable to load default credentials, pretty much ignoring the client email, and private_key credentials. I have had no luck trying to add my google auth json file as a config var to Heroku and found that this is an alternative solution.

@ikhsanalatsary
Copy link
Owner

Hi @burhancoulibaly. Currently not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants