mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
01b77384f9
Allow users to select and save the preferred duo device and method, depending on availability in the duo account. A default enrollment URL is provided and adjusted if returned by the duo API. This allows auto-enrollment if enabled by the administrator. Closes #594. Closes #1039.
24 lines
530 B
JavaScript
24 lines
530 B
JavaScript
/*
|
|
* This is just client script to test the fake API.
|
|
*/
|
|
|
|
const DuoApi = require("@duosecurity/duo_api");
|
|
|
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
|
|
|
|
const client = new DuoApi.Client("ABCDEFG", "SECRET", "duo.example.com");
|
|
console.log("Testing Auth API first");
|
|
client.jsonApiCall(
|
|
"POST",
|
|
"/auth/v2/auth",
|
|
{ username: "john", factor: "push", device: "auto" },
|
|
console.log
|
|
);
|
|
console.log("Testing PreAuth API second");
|
|
client.jsonApiCall(
|
|
"POST",
|
|
"/auth/v2/preauth",
|
|
{ username: "john" },
|
|
console.log
|
|
);
|