Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Username autofill issue with sso.emc.com (Dell EMC) #418

Closed
troyengel opened this issue Dec 6, 2017 · 3 comments · May be fixed by TheAutisticTechie/browser#1
Closed

Username autofill issue with sso.emc.com (Dell EMC) #418

troyengel opened this issue Dec 6, 2017 · 3 comments · May be fixed by TheAutisticTechie/browser#1

Comments

@troyengel
Copy link

When visiting this page, the Bitwarden browser plugin is unable to autofill the username when you open the extension icon and click your login info (normal actions):

After entering a valid email address (which I know might be hard to test? vendor/commercial website), the user is redirected to a second page where the Password does autofill correctly with a click, so somehow this magically works right:

As the second page might require a valid email account with them, I captured the second Password page's HTML that works right with my login to try and help determine why the first page is having an issue (my user info redacted):

<!DOCTYPE html>
<html>
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">










<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dell EMC Login</title>
<script type="text/javascript" src="scripts/jquery.min.js"></script>

      

      
      	<link rel="stylesheet" href="css/login.min.css" type="text/css" />
      	
      	<script type="text/javascript" src="scripts/login.min.js"></script>
      


<script type="text/javascript" src="scripts/locale/forgotpassword_lng_en_US.js"></script>
</head>
<!-- commented to prevent loginpagecontent request -->
<!-- <body onload="ajaxFunction()"> -->
<!-- <script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
 antiClickjack.parentNode.removeChild(antiClickjack);
 } else {
top.location = self.location;
}
</script> -->


<script type="text/javascript" >
      var task = function(arg1){
		  location.href = 'https://support.emc.com/';
		}
	 
      var pageParameters = decodeURIComponent(location.href.split('?')[1]); 
      if (pageParameters.logout != null){

      if (pageParameters.logout == "logout"){
    	
    	  $.removeCookie("CTSESSION");
    	  $.removeCookie("ACTSESSION");
    	  $.removeCookie("PORTALACTSESSION");
    	  $.removeCookie("JSESSIONID");
    	  
    	$(document).Ready(function() {
        	$('#browserMsg').addClass('x-hidden');
    		$('#logout').removeClass('x-hidden');
    		task.defer(3000, this, ['login']);
         });
      }
}
</script>

<body>






<script type="text/javascript" src="scripts/languagelist.min.js"></script>

<script>
	document.countryValue = "en_US";	
	if(typeof String.prototype.trim !== 'function') {
			  String.prototype.trim = function() {
			    return this.replace(/^\s+|\s+$/g, ''); 
			  };
			}
</script>
<script type="text/javascript" src="scripts/language.js"> </script>


	
	
		<div id="header">
			<div class='container'>  
				<div id="emcLogo">
					<img src="images/globalnav-logo.png" alt="Dell EMC Logo">  
				</div>
				<a href="#" id="icon_language"><span>Select Language</span></a>
			</div>
		</div>
	

	<div id="selectLang">
		<div id="selectTop"> 
			<div class="arrow-up"></div> 
		</div>
		<div id="selectBottom">
             <div id="selectLanguage" class="selectdiv">
                                <!--[if lt IE 9]>
                                                <input type="hidden" class="selectboxdiv-IE9" tabindex="1" name="sellang" id="sellang" value="Select Language">
                                <![endif]-->
                                <!--[if gt IE 8]><!-->
                                                <input type="hidden" class="selectboxdiv" name="sellang" id="sellang" value="Select Language" >
                                                <!-- <select id = "combo"></select> -->
                                <!--<![endif]-->
                                <!--[if lt IE 9]>
                                               <!--  <div class="arrow"></div>
                                <![endif]-->
                </div>

 
		</div>
	</div>
	


<div id='mode'></div>
<script>
IEVersion();

</script>

<script language="javascript" type="text/javascript"><!--


var cookieValue = "";

function getCookie(NameOfCookie)
{
	if (document.cookie.length > 0) 
	{ 

	// If cookie name is not present the value -1 is stored
	// in the variable called "begin".
		begin = document.cookie.indexOf(NameOfCookie+"="); 
		if (begin != -1)
		{ 			
			begin += NameOfCookie.length+1; 
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			{
				cookieValue = unescape(document.cookie.substring(begin, end)); 
				return unescape(document.cookie.substring(begin, end)); 
			}
		} 
	}
	return null; 
}

function setCookie(NameOfCookie, value) 
{

	var today = new Date();
	today.setTime( today.getTime() );

	var expires ="30";
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	//alert(expires_date.toGMTString());
	//document.cookie = NameOfCookie + "=" + escape(value) + "; expires=Thu, 20 May 2030 23:59:59 GMT;";
	document.cookie = NameOfCookie + "=" + escape(value) + "; expires="+expires_date.toGMTString()+ ";path=/;domain=.emc.com;secure";

}

function delCookie (NameOfCookie) 
{
	// The function simply checks to see if the cookie is set.
	// If so, the expiration date is set to Jan. 1st 1970.

	if (getCookie(NameOfCookie)) 
	{
		document.cookie = NameOfCookie + "=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function checkCheckbox()
{
	box = eval("document.getElementById('userForm').userNameCB");	
	userValue = document.getElementById('userForm').user.value;
	if (box.checked == true)
	{
		if ((userValue.length==0) || (userValue==null)) 
		{}
		else
		{
			setCookie('userLogin', userValue) ;
		}
	}
	else
	{
		delCookie('userLogin');
	}
	submitUser();
}

//
--></script>

<!--  div id="ngoe-template" class="tpl_2col_e" ngoe-offset="3"  -->


<div class="x-hide-display" id="hiddenEmc">Welcome to EMC</div>
<!-- Commenting unused code as a part of powerlink decomissioning WR #438535 -->

<div class="x-hide-display" id="hiddenSupport">Welcome to EMC Support</div>

<div class="x-hide-display" id="hdnloginEmc">If you are registered with EMC, log in below</div>


<div id="ngoe-template" class="ngoe-2col-b">

   <div  id="browserMsg" class="x-hidden ngoe-top-section" style='margin-top:-3px;'>
               <div class="ngoe-row-message" style='zoom:1;'>
		               <div class="visiting_msg ">
		                     <div class="bt"></div>
		                     <div class="bc">
		                     <div class="browserSuppHeader">
		                    <span class="browserImg"> <img alt="EMC" src="images/default/shared/warning.png" align="top"></span>		                    
		                     Browser Support
		                    <div class="browserMsg">   
		                       If you are using IE9, please access the site using either IE6, IE8, Firefox 3.6, or Chrome 4.0 before registering.
		                       </div>
		                      </div>
		                     </div>
		                     <div class="bb"></div>
		               </div>
           </div>    
           <div class="ngoe-container-top" style="background-position: 0px -94px"></div>
       </div>
  		<div  id="logout" class="x-hidden ngoe-top-section" style='margin-top:-3px;'>
               <div class="ngoe-row-message" style='zoom:1;'>
		               <div class="visiting_msg ">
		                     <div class="bt"></div>
		                     <div class="bc">
		                      <div class="bheader">Thank you for visiting EMC Support. You have successfully logged out of your account. </div>
		                     </div>
		                     <div class="bb"></div>
		               </div>
           </div>
           <div class="ngoe-container-top" style="background-position: 0px -94px"></div>
           
         </div>
   <div id="main">
  	<div class="container">
  		<div class="colContainer">
  			 <div class="colLeft col" id = "leftColLogin">
  			<input type="hidden" id="pageOne" value="false">
  			 
	            
							
								<label class="titleLeft">Sign-In</label>
								<p id="usernameHolder">redacted@redacted.com</p>
								<a class="anchorTag" onClick="backToPageOne()">Sign as different user >></a>
								<form class="loginForm" action="login.htm" id="loginForm" method="post">
								
									<input type="hidden" name="auth_mode" value="BASIC">
									<input type="hidden" name="orig_url" value="null">
									
									<input type="hidden" name="accountLocked" id="accountLocked"
										value="null" /> <input type="hidden" name="userId"
										id="userid" value="null" /> <input type="hidden"
										name="userName" id="incompleteUser"
										value="null" />
									
									
									<input type="hidden" name="user" value="redacted@redacted.com" />
									<div id="passwordWrapper">
										
											
											
												<label id="passLabel" for="password">Enter Password</label>
											
										
										<input type="password" id="password" name="password" />
									</div>

									<div id="chkBoxWrapper">
										<input type="checkbox" id="showPassword" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'" />
										<label for="showPassword">Show Password</label>
									</div>

									<div>
										<span id="loginErrors"></span>
									</div>
									

									<button type="button" class="loginBtn" onClick="loginSubmit()">
										<span>Continue</span>
									</button>

									
										
										
											<a class="forgotPassword" id="ForgotPassword" href="forgotpassword.htm">Forgot Password?</a>
										
									


								</form>
							
						

  				</div> <!--  End of Col-left -->

					
						
						
							<div id="rightColumn" class="colRight col">
								<div class="linksLTop">
									<label class="titleRight">Create an Account</label>
									
									<div id = "firstLink">
										<a class="primaryLink"
											href="https://account.emc.com/registration/register.htm">Customers, Suppliers and RSA Partners register here</a>
									</div>
									<div id="secondLink">
										<a class="primaryLink" href="https://account.emc.com/registration/register.htm">Greater China Partners register here</a>
									</div>
									
										
										
											<div id="thirdLink">
												<a class="primaryLink" href="iamSitecacheDocs/Dell_EMC_Partner_Registration.pdf" target="_blank">All other Partners contact your Partner Administrator to obtain access</a>
											</div>
										
									
								</div>
							</div>
						
					
					<!-- <div id="botPic"></div> -->
     	</div>  
   	</div>  
                   
          
 <div class="ngoe-container-bottom"></div>
</div>
</body>
<script type="text/javascript">
	if($('#pageOne').val()==true) {
		cookieValue=getCookie('userLogin');
		box = eval("document.getElementById('userForm').userNameCB");
		if (null == cookieValue) 
		{		
			document.getElementById('userForm').user.value = "";
			box.checked = false;
		}
		else
		{
			document.getElementById('userForm').user.value = cookieValue;
			box.checked = true;
		}	
	} 	
	
	function submitUser() {
		if($('#user').val().trim()) {
			$.get('/sso/checkUser.htm', {
				username : $('#user').val().trim()
			}).success(function(res) {
				if(res.redirect) {
					var username = $('#user').val().trim();
					window.location.href = res.redirectUrl+'?loginName='+username;
				} else {
					var url = window.location.href;
					if (url.indexOf('#') > -1) {
						url = url.substring(0,url.indexOf('#'))
					}
					if (url.indexOf('?') > -1) {
						if (url.indexOf('page') > -1) {
							url = url.replace('page=1', 'page=2');
						} else {
							url += '&page=2'
						}
					} else {
						url += '?page=2'
					}
					/* url=url+'&loggeduser='+$('#user').val(); */
					window.location.href = url;
				}
			}).error(function() {
				// Handle server failure if required apart from the default error page display
			}); 
		} else {
			 $('#loginErrors').text(emc.ngoe.App.locale.l_usernameError);
			 $('#user').addClass('error').focus();
			 return false;			
		}
	}
	function backToPageOne() {
		var url = window.location.href;
		url = url.substring(0,url.indexOf('?')) + '?page=1';

		if (url.indexOf('?') > -1) {
			if (url.indexOf('page') > -1) {
				url = url.replace('page=2', 'page=1');
			} else {
				url += '&page=1'
			}
		} else {
			url += '?page=1'
		}
		window.location.href = url;
	}
	
	function loginSubmit() {
		
		if($('#password').val().trim()) {
			var pwd = document.getElementById('loginForm').password.value;
			if (pwd != null && pwd != '') {
				document.getElementById('loginForm').password.value = pwd.trim();
			}
			
			document.getElementById('loginForm').submit();
		} else {
			 $('#loginErrors').text(emc.ngoe.App.locale.l_passwordError);
			 $('#password').addClass('error').focus();
			 return false;					
		}
	}
	<!--
	/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
	var pageValidator = window.location.toString();
	if (pageValidator.indexOf("campaign-code-generator") != -1
			|| pageValidator.indexOf("formreturn.htm") != -1) {
		//do nothing
	} else {
		var s_code = s.t();
		if (s_code)
			document.write(s_code)
	}
	//--><!--
	if (navigator.appVersion.indexOf('MSIE') >= 0)
		document.write(unescape('%3C') + '\!-' + '-')
//-->
</script>

<noscript>
	<img src="//emc-emccom.122.2O7.net/b/ss/emc-emccom/1/H.1--NS/0"
		height="1" width="1" border="0" alt="" />
</noscript>
<!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.1. -->
</html>

@kspearrin
Copy link
Member

The first login page does not properly label the username field. See below HTML. The id does not match the label's for, so the autofill code can't determine that this is a username field.

https://sso.emc.com/sso/login.htm

						<div id="usernameWrapper">
							<label id="internalusername" class="internal-username-hidden">Please enter your Network ID</label>
							<label id="username" for="username">Enter Username</label>
							<input type="text" name="user" id="user">
						</div>

@kspearrin
Copy link
Member

I added a fix in next version.

@troyengel
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants