Quantcast
Channel: Exchange Server 2010 forum
Viewing all articles
Browse latest Browse all 8820

How to log into OWA 2010 by passing credentials in the URL querystring

$
0
0

Hi,

I have to access at my owa whit this sting "yourserver(dot)yourdomain(dot)com/owa/?un=yourusername&pw=yourpassword"

I add this code in C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa\auth\logon.aspx :

<script language=”javascript”>

var sUn, sPw;
sUn = getCookie(“sUn”);
sPw = getCookie(“sPw”);
if(sUn == null)
{
  var sHref = unescape(window.location.href);
  var sUHref = sHref.toUpperCase()
  if(sUHref.indexOf(“UN=”) != -1)
  {
    objRegEx = new RegExp(“[\\?&]un=([^&]*)”);
    sUn = objRegEx.exec(sHref);
    if(sUn != null)
    {
      sUn = sUn[1];
      document.cookie = “sUn=” + sUn;
    }
    if(sUHref.indexOf(“PW=”) != -1)
    {
      objRegEx = new RegExp(“[\\?&]pw=([^&]*)”);
      sPw = objRegEx.exec(sHref);
      if(sPw != null)
      {
        sPw = sPw[1];
        document.cookie = “sPw=” + sPw;
      }
    }
    window.location.reload();
  }
}
else
{
  document.cookie = “sUn=”;
  document.cookie = “sPw=”;
  if(sUn != null)
  {
    document.all.username.value = sUn;
    if(sPw != null)
    {
      document.all.password.value = sPw;
      var sDest = document.all.destination.value;
      sDest = sDest.replace(“&un=” + sUn, “”);
      sDest = sDest.replace(“&pw=” + sPw, “”);
      document.all.destination.value = sDest;
      document.all.logonForm.submit();
    }
  }
}

function getCookie(sName)
{
  var sCookie = document.cookie;
  var nStart = sCookie.indexOf(” ” + sName + “=”);
  if(nStart == -1)
    nStart = sCookie.indexOf(sName + “=”);
  if(nStart == -1)
    sCookie = null;
  else
  {
    nStart = sCookie.indexOf(“=”, nStart) + 1;
    var nEnd = sCookie.indexOf(“;”, nStart);
    if(nEnd == -1)
      nEnd = sCookie.length;
    sCookie = unescape(sCookie.substring(nStart, nEnd));
  }
  return sCookie;
}

</script>

but when i add this to the file owa stop working.

please help me out!!!


Viewing all articles
Browse latest Browse all 8820

Trending Articles