Available JQuery Events¶
Some portal functions (such as 2FA registration) are performed by Javascript.
We offer a few custom events that let you react to certain high-level Javascript events
Preventing default behavior¶
New in version 2.17.
Event handlers can stop the default LemonLDAP::NG behavior from executing:
$(document).on( "sslFailure", { }, function( event ) {
event.preventDefault();
// Navigate the user to the smartcard help page, etc.
});
Second factor management¶
mfaAdded¶
New in version 2.0.15.
This event is triggered when a TOTP, WebAuthn or U2F device is registered
Sample code:
$(document).on( "mfaAdded", { }, function( event, info ) {
console.log( "Added MFA of type" + info.type );
// Your code here
});
mfaDeleted¶
New in version 2.0.15.
This event is triggered when a TOTP, WebAuthn or U2F device is removed
Sample code:
$(document).on( "mfaDeleted", { }, function( event, info ) {
console.log( "Removed MFA of type" + info.type );
// Your code here
});
UI¶
portalLoaded¶
New in version 2.0.16.
This even is triggered after the main portal javascript has run
Sample code:
$(document).on( "portalLoaded", { }, function( event, info ) {
// Make sure DOM is ready as well
$( document ).ready(function() {
console.log("Portal loaded and DOM ready");
});
});
Authentication¶
kerberosAttempt¶
New in version 2.17.
This even is triggered immediately before the user tries to authenticate using Kerberos
$(document).on( "kerberosAttempt", { }, function( event ) {
console.log( "Kerberos attempt" );
});
kerberosFailure¶
New in version 2.17.
This even is triggered when the user failed to authenticate using Kerberos
$(document).on( "kerberosFailure", { }, function( event , info ) {
console.log( "Kerberos failure", info );
});
kerberosSuccess¶
New in version 2.17.
This even is triggered when before the user successfully authenticated using Kerberos
$(document).on( "kerberosSuccess", { }, function( event , info ) {
console.log( "Kerberos success", info );
});
sslAttempt¶
New in version 2.17.
This even is triggered immediately before the user tries to authenticate using SSL
$(document).on( "sslAttempt", { }, function( event ) {
console.log( "SSL attempt" );
});
sslFailure¶
New in version 2.17.
This even is triggered when the user failed to authenticate using SSL
$(document).on( "sslFailure", { }, function( event , info ) {
console.log( "SSL failure", info );
});
sslSuccess¶
New in version 2.17.
This even is triggered when before the user successfully authenticated using SSL
$(document).on( "sslSuccess", { }, function( event , info ) {
console.log( "SSL success", info );
});
webauthnAttempt¶
New in version 2.17.
This even is triggered immediately before the user tries to use a WebAuthn device
$(document).on( "webauthnAttempt", { }, function( event ) {
console.log( "WebAuthn attempt" );
});
webauthnFailure¶
New in version 2.17.
This even is triggered when the user failed to use a WebAuthn device
$(document).on( "webauthnFailure", { }, function( event , info ) {
console.log( "WebAuthn failure", info );
});
webauthnSuccess¶
New in version 2.17.
This even is triggered when the user successfully used a WebAuthn device
$(document).on( "webauthnSuccess", { }, function( event , info ) {
console.log( "WebAuthn success", info );
});
webauthnRegistrationAttempt¶
New in version 2.17.
This even is triggered immediately before the user tries to register a WebAuthn device
$(document).on( "webauthnRegistrationAttempt", { }, function( event ) {
console.log( "WebAuthn registration attempt" );
});
webauthnRegistrationFailure¶
New in version 2.17.
This even is triggered when the user failed to register a WebAuthn device
$(document).on( "webauthnRegistrationFailure", { }, function( event , info ) {
console.log( "WebAuthn registration failure", info );
});
webauthnRegistrationSuccess¶
New in version 2.17.
This even is triggered when the user successfully registered a WebAuthn device
$(document).on( "webauthnRegistrationSuccess", { }, function( event , info ) {
console.log( "WebAuthn registration success", info );
});