Quantcast
Viewing all articles
Browse latest Browse all 9859

Struggling with multiple domains, here is a different approach to the logon

We have a single tenant and multiple domains. To make logon easier for these users we updated the login page. This modification was done to make it so the user only has to put in the username and password. From there they can select the domain. It added the domain to the user name so that the user does not have to know what that full username looks like in proper form.

 

Path to file:

/usr/lib/vmware-sts/webapps/websso/WEB-INF/views

 

Modified the file unpentry.jsp

 

 

 

First modification is to the section that create the variable to pass to the SSO. It is about half way down the file. I have pasted the section of code in blue below and the modifications in red.

 

function submitentry() {

        // calculate redirect URL

        var originalurl;

        var url;

        originalurl = document.URL;

        url = originalurl.replace("${searchstring}", "${replacestring}");

 

        // get the field values

        var submit = document.getElementById("submit");

        var sspiCheckbox = document.getElementById("sspiCheckbox");

        var progressBar = document.getElementById("progressBar");

        var sspiLogin = sspiCheckbox.checked;

        var domain = document.getElementById("domain").value;

        var username = document.getElementById("username").value;

        var password = document.getElementById("password").value;

 

        // Note: it is perfectly fine for the password field to be empty.

        if (username != "" || sspiLogin) {

                // Display progress bar

                progressBar.style.display = "block";

                var response = document.getElementById('response');

                response.style.display = "none";

 

                // Disable the fields.

                disableFields(true);

 

                var unp = username + "@" + domain + ":" + password;

                unp = Base64.encode(unp);

 

The second section that was modified was for the display. There was an additional line added to allow for the dropdown box and added the variable Domain.to add additional domains you would just add the domain in an option line. The domain is listed without the @ symbol to make it simple to pass. It was put at the bottom because of the clear text label interferes with the variable labels. The check box was type was changed to hidden for this reason and to not change the logic for the page.

 

<div id="loginForm">

 

<p class="loginRow" >

<span class="loginLabel">${username}:</span>

<input id="username" class="margeTextInput" type="text" />

</p>

 

 

<p class="loginRow" >

<span class="loginLabel">${password}:</span>

<input id="password" class="margeTextInput" type="password" />

</p>

<p class="loginRow" >

      <span class="loginLabel">Domain:</span>

 

      <select id="domain" class="margeTextInput" type="text" />

<option value="domain.com" < test="${item.domain == "domain.com"}"> <out value= "selected=selected"/</if>DOMAIN</option>

<option value="new.domain.com" < test="${item.domain == "new.domain.com"}"> <out value= "selected=selected"/</if>NEW</option>

<option value="that.domain.com" < test="${item.domain == "that.domain.com"}"> <out value= "selected=selected"/</if>THAT</option>

    </p>

 

<p id="sessionID">

       <!--<label id="checkboxLabel"><input id="sspiCheckbox" disabled="true" type="checkbox" onchange='enableSspi(this);'/>${winSession}</label>-->

        <label id="checkboxLabel"><input id="sspiCheckbox" disabled="true" type="hidden" onchange='enableSspi(this);'/></label>

</p>

<p><br></p>   

<p id="loginButtonRow">

       <input id="submit" class="button blue" type="submit" value=${login} onclick="submitentry()"/>

</p>

</div>

 

<div id="productName">


Viewing all articles
Browse latest Browse all 9859

Trending Articles