0.0.7 • Published 6 years ago
kemp-forms-auth v0.0.7
This is a simple module to get the required cookie to authenticate with the KEMP ESP.
Please note that this code contains verry little error handling.
https://support.kemptechnologies.com/hc/en-us/articles/203125029-Edge-Security-Pack-ESP-
Example usage. This returns a JSON object containing the KEMP auth cookie.
var kempauth = require('kemp-forms-auth');
//define our Async Authenticate function
async function main(callback) {
var authOptions = {
"username": "username",
"password": "password",
"url": "https://sub.domain.com"
};
var authCookie = await kempauth.login(authOptions);
callback(authCookie);
};
//Run the Async Function we just defined
main(function (authCookie) {
if (authCookie.Error) {
console.log(authCookie.Error);
} else {
console.log(authCookie);
};
});