As do Internet-facing deployment (IFD) of Dynamics 365 custom login account format

I am a Microsoft Dynamics 365 & Power Platform aspects engineer Rayong, Microsoft Most Valuable Professional is the July 2015 to June 2018 for three consecutive years Dynamics CRM / Business Solutions aspects (Microsoft MVP), I welcome the attention of the public micro-channel number MSFTDynamics365erLuoYong, reply or 20,190,817 354 may facilitate access to this article, but you can get the latest information I Bowen issued in the first room, follow me!

Before my stuff  done Internet-facing deployments Dynamics 365 CE to change the AD FS login page talked about some of the AD FS login page customization, some friends asked me to enter a user name when you can not enter the domain name it? For example, a user name before I enter is [email protected], I can only enter crmadmin as the user name? Of course it can, I am here, according to official documents  of AD FS Sign-in Pages Advanced Customization customization.

Because I do custom theme before, I am here to directly modify the custom theme. First you need to export the theme, use something like the following command:

Export-AdfsWebTheme –Name LuoYongTheme –DirectoryPath C:\LuoYongTheme

 

 

Script file and then modify the export folder in a folder below onload.js, add the following code:

if (typeof Login != 'undefined') {
    Login.submitLoginRequest = function () {
        var u = new InputUtil();
        var e = new LoginErrors();
        var userName = document.getElementById(Login.userNameInput);
        var password = document.getElementById(Login.passwordInput);
        if (userName.value && !userName.value.match('[@\\\\]')) {
            var userNameValue = userName.value + '@luoyong.me';
            document.forms['loginForm'].UserName.value = userNameValue;
        }

        if (!userName.value) {
            u.setError(userName, e.userNameFormatError);
            return false;
        }

        if (!password.value) {
            u.setError(password, e.passwordEmpty);
            return false;
        }
        document.forms['loginForm'].submit();
        return false;
    };
}

 

Then execute the following code using the PowerShell command:

Set-AdfsWebTheme -TargetName LuoYongTheme -OnLoadScriptPath "C:\LuoYongTheme\script\onload.js"

 

Of course, also you need to use the Set-AdfsWebConfig set this theme as the default theme because my previous post has been set to the default theme will not be needed. AD FS service does not need to restart immediately into effect.

Guess you like

Origin www.cnblogs.com/luoyong0201/p/Dynamics_365_Customer_Engagement_IFD_Customize_Login_Format.html