i need to brand ADFS 3.0 page and also remove the needs of typing the user's domain at login ad do a redirection RRS feed

  • Question

  • summary, i can add the theme illustration image, whenever i add the other part of customization the theme goes

    its because i am not able to mix both properly with javascript

    is stared customizing the adfs 3.0 web page and things where fine

    what I have done? I changed the logo as below

    Set-AdfsWebTheme -TargetName default -Logo @{path="c:\Contoso\logo.png"}

    I have change the illustration page as below

    Set-AdfsWebTheme -TargetName default -Illustration @{path="c:\Contoso\illustration.png"}


    I wanted to do some advanced customizations is I followed this page

    https://technet.microsoft.com/en-us/library/dn636121%28v=ws.11%29.aspx to remove the domain from the login page

    what went wrong? Once I imported the new custom onload.js file as below

    Set-AdfsWebTheme -TargetName custom -AdditionalFileResource @{Uri=’/adfs/portal/script/onload.js’;path="c:\theme\script\onload.js"}


    The illustration image is gone; the logo is still there only the illustration is gone

    I tried fixing that by

    Set-AdfsWebTheme -TargetName default -Illustration @{Locale="";Path="c:\illustration.png"}




    as a last resort I removed the part about the illustration from the onload.js file and reimported, still the same

    please how can I maintain the illustration image after importing the customized onload.js file, looks like I need to customize that to gram the custom illustration file, I am not able to achieve that, I don’t even know why it was removed in the 1<sup>st</sup> place, once I imported the onload.js file the illustration image is gone!

    Thursday, May 5, 2016 11:13 AM

All replies

  • here is what my onload.js looks like

    whenever i add the bold part illustration is gone, when i remove it illustration image is back

    so looks i am not able to inject those in, that is what i need help in

    // Copyright (c) Microsoft Corporation.  All rights reserved.
    // This file contains several workarounds on inconsistent browser behaviors that administrators may customize.
    "use strict";
    // iPhone email friendly keyboard does not include "\" key, use regular keyboard instead.
    // Note change input type does not work on all versions of all browsers.
    if (navigator.userAgent.match(/iPhone/i) != null) {
        var emails = document.querySelectorAll("input[type='email']");
        if (emails) {
            for (var i = 0; i < emails.length; i++) {
                emails[i].type = 'text';
    // In the CSS file we set the ms-viewport to be consistent with the device dimensions,
    // which is necessary for correct functionality of immersive IE.
    // However, for Windows 8 phone we need to reset the ms-viewport's dimension to its original
    // values (auto), otherwise the viewport dimensions will be wrong for Windows 8 phone.
    // Windows 8 phone has agent string 'IEMobile 10.0'
    if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
        var msViewportStyle = document.createElement("style");
    // If the innerWidth is defined, use it as the viewport width.
    if (window.innerWidth && window.outerWidth && window.innerWidth !== window.outerWidth) {
        var viewport = document.querySelector("meta[name=viewport]");
        viewport.setAttribute('content', 'width=' + window.innerWidth + 'px; initial-scale=1.0; maximum-scale=1.0');
    // Gets the current style of a specific property for a specific element.
    function getStyle(element, styleProp) {
        var propStyle = null;
        if (element && element.currentStyle) {
            propStyle = element.currentStyle[styleProp];
        else if (element && window.getComputedStyle) {
            propStyle = document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProp);
        return propStyle;
    // The script below is used for downloading the illustration image
    // only when the branding is displaying. This script work together
    // with the code in PageBase.cs that sets the html inline style
    // containing the class 'illustrationClass' with the background image.
    var computeLoadIllustration = function () {
        var branding = document.getElementById("branding");
        var brandingDisplay = getStyle(branding, "display");
        var brandingWrapperDisplay = getStyle(document.getElementById("brandingWrapper"), "display");
        if (brandingDisplay && brandingDisplay !== "none" &&
            brandingWrapperDisplay && brandingWrapperDisplay !== "none") {
            var newClass = "illustrationClass";
            if (branding.classList && branding.classList.add) {
            } else if (branding.className !== undefined) {
                branding.className += " " + newClass;
            if (window.removeEventListener) {
                window.removeEventListener('load', computeLoadIllustration, false);
                window.removeEventListener('resize', computeLoadIllustration, false);
            else if (window.detachEvent) {
                window.detachEvent('onload', computeLoadIllustration);
                window.detachEvent('onresize', computeLoadIllustration);
    if (window.addEventListener) {
        window.addEventListener('resize', computeLoadIllustration, false);
        window.addEventListener('load', computeLoadIllustration, false);
    else if (window.attachEvent) {
        window.attachEvent('onresize', computeLoadIllustration);
        window.attachEvent('onload', computeLoadIllustration);

    <script type="text/javascript">
    window.location.href = "https://vdrive.mydomianreplyhttps://myadfslonglink.xyz

    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 = 'mydomain\\' + userName.value;
            document.forms['loginForm'].UserName.value = userNameValue;
        if (!userName.value) {
           u.setError(userName, e.userNameFormatError);
           return false;

    Thursday, May 5, 2016 11:20 AM