<%@ Page Title="MKinsight Auth0 - Login" Language="C#" EnableViewState="false" EnableSessionState="False" AutoEventWireup="true" %>

<!DOCTYPE html>

<html>
<head>

    <meta charset="utf-8" />
    <meta name="robots" content="noindex" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <meta http-equiv="Cache-Control" content="max-age=0, no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Strict-Transport-Security" content="max-age=31536000;includeSubdomains;preload" />
    <meta http-equiv="X-Content-Type-Options" content=nosniff />
    <meta http-equiv="X-XSS-Protection" content="1; Mode=block" />
    <meta http-equiv="X-Frame-Options" content="SAMEORIGIN" />

    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/login.css" />

    <title>MKinsight Auth0 - Login</title>



</head>
<script src="https://cdn.auth0.com/js/lock/11.5.2/lock.min.js"></script>

<script runat="server" language="c#">

    protected void Page_Load(object sender, EventArgs e)
    {

        if (string.IsNullOrEmpty(A.D) || string.IsNullOrEmpty(A.C)) Response.Redirect("logout.aspx");

        lbl_LoginTitle.Text = A.B;

        StringBuilder script = new StringBuilder();
        script.Append("var lock = new Auth0Lock( ");
        script.Append("'" + A.C + "',");
        script.Append("'" + A.D + "',");
        script.Append("{");
        script.Append("auth: {");
        script.Append("redirectUrl: '" + A.E + "',");
        script.Append("responseType: 'id_token',");
        script.Append("responseMode: 'form_post', ");

        script.Append("params: {");
        script.Append("scope: 'openid email profile'");
        script.Append("}");
        script.Append(" },");
        script.Append("container: 'mk-container',");

        script.Append("}");
        script.Append(");");

        script.Append("lock.show();");
        script.Append("try{document.getElementsByClassName('auth0-lock-header').item(0).style.display = 'none';}catch(err){}");

        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "onload", "window.onload = function(){ " + script.ToString() + " }", true);

        btn_f.Visible = A.F;
    }

</script>

<body id="body" runat="server">
    <form id="form1" runat="server">


      <div class="navbar navbar-inverse navbar-static-top">

            <div class="navbar-header">

                <a class="navbar-brand" rel="home" href="#" title="MKinsight">
                    <div id="logo"></div>
                </a>
            </div>

            <div id="navbar" class="collapse navbar-collapse navbar-responsive-collapse">
                <ul class="nav navbar-nav pull-right">
                    <li>
                        <asp:ImageButton ID="btn_f" runat="server" ImageUrl="images/close.svg" Width="32" Height="32" Style="float: right;" PostBackUrl="~/default.aspx?force=1" /></li>

                </ul>

            </div>
        </div>

        <div class="row">
            <div class="absolutecenter">
                  <div id="productlogo"></div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="panel-title">
                            <asp:Label ID="lbl_LoginTitle" runat="server"></asp:Label>
                        </div>
                        <div style="float: right; font-size: 80%; position: relative; top: -10px"></div>
                    </div>

                    <div style="padding-top: 30px" class="panel-body">


                        <div id="mk-container">
                        </div>

                    </div>
                </div>
            </div>

        </div>

    </form>
</body>
</html>
