CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    2

    automatically login to a website via javascript

    Good Morning Gentlemen,

    i am trying to add a shortcut to an internal website that will automatically log in to a public website so that the users dont have to keep entering in the username and password. I did some research and tried the following code below but it does not work. Please advise.

    Code:
    <HTML>
    <HEAD>
    <TITLE>
    Login</TITLE>
    <script>
    <!--
    function login() {
    document.form.action="https://www.mykonicaminolta.com/wps/portal/mkm/hidden/login/!ut/p/b1/hY5dC4IwGIV_0t6ZW_NSGzXDmZqV240IfaD4ESKS_voWBF1V5-7A8xwO0khRIIRixlCGdFuM5a0Yyq4t6lfXNBc8AsfDLoDYAPhim3hWFC4YxwZQBoAvceGff0IZ2Pm-Ync5DVkwr8a0muNJVgpCLrGs4lkO1-h8TA6ey3vSPwrj6J-zhL6BH7dC0TUXpAy2_OwwcNbgkzDdJdKC2AbU6DqgCfOf_7Fwww!!/dl4/d5/L0lDU0lKSmdwcGchIS9JRFNBQ0lpTXlDb2tBSUFtaWdZIS80RzNhRDJnanZ5aERVd2chL1o3X0hEUDA5QjFBMDgwOUYwSTVOVE9STTIwUTQwLzAvMjIzMTE3MDYzNjMw/";
    document.form.submit();
    }
    //-->
    </script>
    </HEAD>
    <BODY onLoad="login()">
    <FORM NAME="form" METHOD="GET">
    <INPUT TYPE="hidden" NAME="LoginPortletFormID" VALUE="username">
    <INPUT TYPE="hidden" NAME="LoginPortletFormPassword" VALUE="password">
    </FORM>
    </BODY>
    </HTML>


    thank you!!

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: automatically login to a website via javascript

    If the form processing is done correctly, it will check the HTTP referrer and make sure the form is coming from it's own site, not anyone elses. If that is the case, you will not be able to auto-login using a custom made form from another web server.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured