Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
ddp-login makes it super easy to programmaticly authenticate with Meteor server using the DDP protocol.
It is an node.js npm package built on top of the ddp package.
# For programmatic use in a node.js program:
npm install ddp-login
# For use in shell scripts
npm -g install ddp-login
There are two possible ways to use this package.
If you'd like to log in and obtain an authentication token from a Meteor server within a node.js program:
var DDP = require('ddp');
var login = require('ddp-login');
var ddpClient = new DDP({
host: "localhost",
port: 3000
});
// Options below are the defaults
login(ddpClient,
{
env: 'METEOR_TOKEN', // Name of an environment variable to check for a good token
// If a token is found and is good, authentication will require no
// user interaction.
method: 'email' // Login method: email or username
retry: 5 // Number of login attempts to make
},
function (error, token) {
if (error) {
// Something went wrong...
} else {
// We are now logged in, with token as our session resume authToken...
}
}
);
Here's how to securely set an environment variable with an authentication token that can be used by other programs to avoid a user having to repeatedly enter credentials at the shell.
export METEOR_TOKEN=$(ddp-login --host 127.0.0.1 --port 3000 --env METEOR_TOKEN --method email)
The above will only work if ddp-login
was installed with the npm -g
option, or if it is run directly using node.js.
v0.0.0
FAQs
Login to a Meteor server via DDP and obtain an authentication token
The npm package ddp-login receives a total of 128 weekly downloads. As such, ddp-login popularity was classified as not popular.
We found that ddp-login demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.