Support private key as authentication vs file?
See original GitHub issueI currently find the library to be a bit inconsistent when it comes to private keys. As a user I am left to write a key to file:
var Nexmo = require('nexmo');
var nexmo = new Nexmo({
apiKey: 'key',
apiSecret: 'secret',
});
nexmo.app.create(
'First Voice App',
'voice',
'http://example.com/answer',
'http://example.com/event',
{},
function(err, res) {
var appId = res.id;
var privateKey = res.keys.private_key;
var privateKeyFile = __dirname + '/' + appId;
require('fs').writeFileSync(privateKeyFile, privateKey);
}
);
But then when I try to configure the library with a key it requires a filename and reads the file:
nexmo = new Nexmo({
apiKey: 'key',
apiSecret: 'secret',
applicationId: appId,
privateKey: privateKeyFile
});
I somehow think it would make a lot more sense for the initializer to just accept the key itself and not bother itself with reading from disc. This would also make it possible to create an app and then reinitialize the library in a few lines of code without having to write the key to disc.
Final note: I might want to save my API key somewhere else on the disk (another volume, database, etc) so having this option would be useful regardless.
Thoughts @leggetter @tjlytle ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
What is SSH Public Key Authentication?
With SSH, public key authentication improves security considerably as it frees the users from remembering complicated passwords.
Read more >Setting Up Public-Private Keys For SSH Authentication
The more pedantic in the tech community argue about the merits of public-private key authentication vs. simple password authentication when ...
Read more >Are SSH Keys or Passwords Better for SFTP Authentication?
Which is better for SFTP authentication: SSH keys or passwords? Explore the pros and cons of each method in this post.
Read more >What Is an SSH Key? | Sectigo® Official
The SSH key pair is used to authenticate the identity of a user or process that wants to access a remote system using...
Read more >Public and Private Key Based Authentication
File Processor Connector supports public and private key based authentication for an FTP server (FTP over SSH). File Processor Connector supports FTP over...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@leggetter check, I just figured that out. I was going to suggest similar behaviour for the node library indeed.
Closed via #80