(function ()
{
    var formData = new FormData();
    formData.append("client_id", "116a7b0228624124ab9bfe9f18f1d896");
    formData.append("redirect_uri", "https://moi.gov.ae/sso/callback.aspx");
    formData.append("scope", "openid profile");
    formData.append("response_mode", "moi_response");
    formData.append("response_type", "code");
    formData.append("prompt", "silent");

    var xhr = new XMLHttpRequest();

    if ("withCredentials" in xhr)
    {
        xhr.open("POST", "https://login.moi.gov.ae/v1/oidc/auth", true);
        xhr.withCredentials = true;

    }
    else if (typeof XDomainRequest != "undefined")
    {
        xhr = new XDomainRequest();
        xhr.open("POST", "https://login.moi.gov.ae/v1/oidc/auth");
    }
    else { xhr = null; }
    if (xhr)
    {
        xhr.onload = function () { if (xhr.status == 200) { window["getSSOToken"](xhr.response); } };
        xhr.send(formData);
    }
})();