Automated Log in to SmarterTrack
Problem reported by Frank Cheung - August 15, 2014 at 3:54 PM
Resolved
With older version of smarterTrack (v7), i am able to use the follow code to perform automatic login to Track.  I can no longer do that with the latest version of Track.
 
This method is also detailed in http://portal.smartertools.com/kb/a2450/automate-user-login-to-smarterstats.aspx for SmarterStats.
 
Any idea?  Is this feature no longer supported?  What is the alternative?
 
<head>
</head>
<body>
<form id="form1" runat="server">
    <!-- Automated SmarterTrack Login fields-->
    <input type="hidden" name="shortcutLink" value="autologin" id="shortcutLink" />
    <input type="hidden" name="loginUsername" id="loginUsername" value="username" />
    <input type="hidden" name="loginPassword" id="loginPassword" value="password" />
    <input type="hidden" name="portalurl" id="portalurl" value="http://xxxx" />
    <script language="javascript" type="text/javascript">
        var f = document.forms[0];
        f.action = f.portalurl.value;
        f['__VIEWSTATE'].name = 'NOVIEWSTATE';
        if(f.portalurl.value != '')
        {
            f.submit();
        }
    </script>
    
    Attempting login to SmarterTrack...<br />
    <br />
</form>
</body>
</html>

6 Replies

Reply to Thread
1
Employee Replied
Employee Post
Hi Frank,
 
A few things will fix the code you posted.
 
Remove the following line or add a null check:
f['__VIEWSTATE'].name = 'NOVIEWSTATE'
f['__VIEWSTATE'] could be null and accessing the name property of a null object will cause the script to crash.
 
Also, you will need to change the name of the login and password properties.
"loginUsername" should be changed to "Username"
"loginPassword" should be changed to "Password"
 
After those changes are made it should start working!
 
Cheers,
Mike
0
Hello Mike.
 
Changed the code to following but it doesn't work.  Any idea?  Thanks.
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<form id="form1" runat="server">
    <!-- Automated SmarterTrack Login fields-->
    <input type="hidden" name="shortcutLink" value="autologin" id="shortcutLink" />
    <input type="hidden" name="Username" id="Username" value="username" />
    <input type="hidden" name="Password" id="Password" value="password" />
    <input type="hidden" name="portalurl" id="portalurl" value="http://xxxx" />
    <script language="javascript" type="text/javascript">
        var f = document.forms[0];
        f.action = f.portalurl.value;
        if(f.portalurl.value != '')
        {
            f.submit();
        }
    </script>
    
    Attempting login to SmarterTrack...<br />
    <br />
</form>
</body>
</html>
0
No.  The URL is http://portalURL/Main/Default.aspx
 
From my understanding, the /login.aspx page only take you into the Agent Interface, is that right?  I can't even login from that page with regular user account.
1
Derek Curtis Replied
Employee Post
This is an issue with SmarterTrack. Therefore, I changed this from a Question to a Problem as our developers are working on resolving the issue. It will appear in a future minor release.
Derek Curtis
COO
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
3
Employee Replied
Employee Post
We were able to identify and fix this issue before todays minor release.
0
Hello Guys.
 
I updated to the latest version.
 
My current code still doesn't work
 
<form id="form1" runat="server">
    <!-- Automated SmarterTrack Login fields-->
    <input type="hidden" name="shortcutLink" value="autologin" id="shortcutLink" />
    <input type="hidden" name="username" id="username" value="username" />
    <input type="hidden" name="password" id="password" value="password" />
    <input type="hidden" name="portalurl" id="portalurl" value="http://portalurl/main/default.aspx" />
    <script language="javascript" type="text/javascript">
        var f = document.forms[0];
        f.action = f.portalurl.value;
        f['__VIEWSTATE'].name = 'NOVIEWSTATE';
        if(f.portalurl.value != '')
        {
            f.submit();
        }
    </script>
    
    Attempting login to SmarterTrack...<br />
    <br />
</form>

Reply to Thread