Skip to content

Instantly share code, notes, and snippets.

@peterhughesdev
Created January 29, 2020 16:15
Show Gist options
  • Save peterhughesdev/9a59373b2df2859cb72faf442e243206 to your computer and use it in GitHub Desktop.
Save peterhughesdev/9a59373b2df2859cb72faf442e243206 to your computer and use it in GitHub Desktop.
Diffusion Authenticator example
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