-
-
Save brianunlam/72d3983e14ca3c76358abff0d6474d94 to your computer and use it in GitHub Desktop.
Diffusion Authenticator example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let session = await diffusion.connect({ | |
host: <host>, | |
principal: <admin username>, | |
credentials: <admin password> | |
}); | |
let authenticator = { | |
authenticate(principal, credentials, sessionProperties, proposedProperties, callback) { | |
console.log('Auth:', principal, proposedProperties); | |
callback.allow({}); | |
}, | |
onClose() { | |
console.log('Close'); | |
}, | |
onError(error) { | |
console.error(error); | |
} | |
}; | |
let registration = await session.security.setAuthenticator('after-system-handler', authenticator); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment