Web Session Embedded JavaScript Custom Script for auto fill Microsoft web authentication.

Web Session Embedded JavaScript Custom Script for auto fill Microsoft web authentication.

0 vote

avatar

I have seen many request the usage of how to auto fill more complicated login form and had success using this for microsoft logins. hope other can use it as well. Remember the web session need enable %PASSWORD% enable under more option / security. And this has been tested with Edge Embedded browser

// Set the username and password

var username = "$USERNAME$";
var password = "$PASSWORD$";

// Get the username input field by id and set its value
var usernameField = document.getElementById("i0116");
usernameField.value = username;

// Dispatch an input event for username
var event = new Event('input', {
    bubbles: true,
    cancelable: true,
});

usernameField.dispatchEvent(event);

// Click the "Next" button
setTimeout(function() {
    document.getElementById("idSIButton9").click();

    // Wait for the new form to load, then fill in the password
    setTimeout(function() {
        var passwordField = document.getElementById("i0118");
        passwordField.value = password;

        // Dispatch an input event for password
        var event = new Event('input', {
            bubbles: true,
            cancelable: true,

        });
        passwordField.dispatchEvent(event);

        // Click the "Submit" button (replace "idSIButton9" with the actual id of your submit button)
        setTimeout(function() {
            document.getElementById("idSIButton9").click();
        }, 0);
    }, 1500);
}, 200);

All Comments (2)

avatar

It could be a great feature if Devolution added some password fill templates so the community could share fill scripts as the automatic and discover mostly don't work

avatar

Hello Danny,

Thank you for providing the script, I believe it will be beneficial for other users!

Please note I moved the thread to the feature request section for your second post since it would be more appropriate there.

Best regards,

Richard Boisvert