Default login domain for the ADFS 3.0 change password page

You might have seen that it is possible to customize the ADFS form-based authentication page to programmatically add the domain name when the user provides a sam-account name without the domain. To achieve the same result on the ADFS 3.0 change password page I put together the following JavaScript code that will need to be added to the onload.js that is provided by ADFS:

var oldVersionOfFunc = UpdatePassword.submitPasswordChange;

UpdatePassword.submitPasswordChange = function() {

  var userName = document.getElementById("userNameInput");

  if (userName.value && !userName.value.match('[@\\\\]'))
    var userNameValue = 'MyNetbiosDomainName\\' + userName.value;
    document.forms['updatePasswordForm'].UserName.value = userNameValue;

  return oldVersionOfFunc.apply(oldVersionOfFunc, args);

Where MyNetbiosDomainName is the NetBIOS domain name for your domain.

Comments (2)

  1. Chris says:

    No matter what, this absolutely doesn’t work on Server 2016 Standard version 1607, build 14393.2035.

    1. esseemme says:

      Chris what I provided is simple javascript code that adds on behalf of the user the domain name. If javascript is enabled on the user’s browser, it works correctly regardless of the specific server version/build.

Skip to main content