<%@ Page Title="" Language="C#" MasterPageFile="~/UGCCNG.Master" AutoEventWireup="true" CodeBehind="tfa.aspx.cs" Inherits="UGCC_Sharp.tfa" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="View0" runat="server">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">About two factor authentication</h3>
                </div>
                <div class="panel-body">
                    Two factor authentication (TFA) helps to secure your account.&nbsp; It requires an additional pin number to be entered when logging in.&nbsp; You can use an application such as Google Authenticator installed on your mobile device to generate this pin.&nbsp; To enable TFA for your account, click enable to begin the process.</div>
            </div>
            <div class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        Two factor auth status</label>
                    <div class="col-sm-10">
                        <div id="divStatus" runat="server"></div>
                        <span class="help-block">Indicates whether TFA is enabled on your account.</span>
                    </div>
                </div>
            </div>
            <asp:Button ID="btnEnable" class="btn btn-primary" runat="server" Text="Enable" OnClick="btnEnable_Click" />
            <asp:Button ID="btnDisable" class="btn btn-primary" runat="server" Text="Disable" OnClick="btnDisable_Click" />
        </asp:View>
        <asp:View ID="View1" runat="server">
            On your mobile device install Google Authenticator.&nbsp; Then enter the following secret, or alternatively scan the QR code.&nbsp; To verify that everything is working correctly, enter the code generated and click submit.&nbsp; Once validated your account will be secured with TFA.<br />
            <br />
            Your secret:  <div id="divSecret" runat="server"></div>
            <br />
            QR code:  <div id="divQR" runat="server"></div>
            <br />
            Please enter the pin shown on your device to verify everything is working correctly.<br />
            <asp:TextBox ID="txtCode" CssClass="form-control" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" CssClass="btn btn-default" runat="server" Text="Submit" OnClick="Button1_Click" />
            <br />

        </asp:View>
        <asp:View ID="ViewGood" runat="server">
            <div id="divResult" runat="server" class="alert alert-success">Everything checks out, TFA successfully setup on your account</div>

        </asp:View>
    </asp:MultiView>

</asp:Content>
