Created
January 29, 2020 16:15
-
-
Save peterhughesdev/9a59373b2df2859cb72faf442e243206 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