Click here to Skip to main content
11,927,378 members (44,427 online)
Click here to Skip to main content
Add your own
alternative version


12 bookmarked

Direct OWA Login

, 28 Jul 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
Directly login in OWA interface bypassing the login screen.


There are times when we need to redirect a user from one application to web mail access or OWA (Office Web Access) by bypassing the login screen of the OWA. Let me share a script and technique to do so.

Using the code

Here is the JavaScript function:

function DirectLogin (vstrServer, vstrDomain, vstrUsername, vstrPassword) {
      //var url = "https://" + server + "/exchweb/bin/auth/owaauth.dll";
      var strUrl = "https://" + vstrServer + "/exchweb/bin/auth/owaauth.dll";
      var strExchange = {destination:'https://' + vstrServer + 
         trusted:'0',isutf8:'1',username:vstrDomain + 
         '\\' + vstrUsername,password:vstrPassword};
      var myForm = document.createElement("form");
      myForm.method="post" ;
      myForm.action = url ;

      for (var varElement in strExchange) {
        var myInput = document.createElement("input") ;
        myInput.setAttribute("name", varElement) ;
        myInput.setAttribute("value", strExchange[varElement]);
        myForm.appendChild(myInput) ;
      document.body.appendChild(myForm) ;
      myForm.submit() ;
      document.body.removeChild(myForm) ;

Here is the HTML:

<body onload="javascript:DirectLogin(‘servername','domain','username','password');">

In the above code snippet, there is a JavaScript method that actually bypasses the OWA login screen. Please note that the input to the scripts are very important, and also the path of the owaauth.dll file on the server that is set in the DirectLogin method.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...

Comments and Discussions

NewsA small bug & Thx Pin
waelElgayar15-Sep-10 10:49
memberwaelElgayar15-Sep-10 10:49 
Above there, you need to modify the code to use strUrl instead of url variable.
Also please add a note that the Exchange server OWA should be using forms authentication method and not any other one, that's why it does not work by default for Exchange 2010, and this is how to change it[^]

Finally, Thanks for your great help Smile | :)
Questiondesktop version?? Pin
Tanmay Broachwala20-Aug-09 0:10
memberTanmay Broachwala20-Aug-09 0:10 
AnswerRe: desktop version?? Pin
sanong31-Jan-10 5:58
membersanong31-Jan-10 5:58 
QuestionVersion... Pin
Serverside28-Jul-09 2:24
memberServerside28-Jul-09 2:24 
AnswerRe: Version... Pin
Robin_Roy28-Jul-09 17:32
memberRobin_Roy28-Jul-09 17:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 28 Jul 2009
Article Copyright 2009 by Robin_Roy
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid