<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
    <h1>Authentication</h1>

    <kc-tabs-authentication></kc-tabs-authentication>

    <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
        <div class="form-group">
            <label for="type" class="col-md-2 control-label">OTP Type</label>
            <div class="col-md-2">
                <div>
                    <select id="type" ng-model="realm.otpPolicyType" class="form-control">
                        <option value="totp">Time Based</option>
                        <option value="hotp">Counter Based</option>
                    </select>
                </div>
            </div>
            <kc-tooltip>totp is Time-Based One Time Password.  'hotp' is a counter base one time password in which the server keeps a counter to hash against.</kc-tooltip>
        </div>
        <div class="form-group">
            <label for="alg" class="col-md-2 control-label">OTP Hash Algorithm</label>
            <div class="col-md-2">
                <div>
                    <select id="alg" ng-model="realm.otpPolicyAlgorithm" class="form-control">
                        <option value="HmacSHA1">SHA1</option>
                        <option value="HmacSHA256">SHA256</option>
                        <option value="HmacSHA512">SHA512</option>
                    </select>
                </div>
            </div>
            <kc-tooltip>What hashing algorithm should be used to generate the OTP.</kc-tooltip>
        </div>

        <div class="form-group">
            <label class="col-md-2 control-label" for="digits">Number of Digits</label>
            <div class="col-md-2">
                <div>
                    <select id="digits" ng-model="realm.otpPolicyDigits" class="form-control">
                        <option value="6">6</option>
                        <option value="8">8</option>
                    </select>
                </div>
            </div>
            <kc-tooltip>How many digits should the OTP have?</kc-tooltip>
        </div>

        <div class="form-group">
            <label class="col-md-2 control-label" for="lookAhead">Look ahead window</label>
            <div class="col-md-6">
                <input class="form-control" type="number" required min="1" max="120" id="lookAhead" name="lookAhead" data-ng-model="realm.otpPolicyLookAheadWindow" autofocus>
            </div>
            <kc-tooltip>How far ahead should the server look just in case the token generator and server are out of time sync or counter sync?</kc-tooltip>
        </div>

        <div class="form-group" data-ng-if="realm.otpPolicyType == 'hotp'">
            <label class="col-md-2 control-label" for="counter">Initial Counter</label>
            <div class="col-md-6">
                <input class="form-control" type="number" data-ng-required="realm.otpPolicyType == 'hotp'" min="1" max="120" id="counter" name="counter" data-ng-model="realm.otpPolicyInitialCounter" autofocus>
            </div>
            <kc-tooltip>What should the initial counter value be?</kc-tooltip>
        </div>

        <div class="form-group" data-ng-if="realm.otpPolicyType == 'totp'">
            <label class="col-md-2 control-label" for="counter">OTP Token Period</label>
            <div class="col-md-6">
                <input class="form-control" type="number" data-ng-required="realm.otpPolicyType == 'totp'" min="1" max="120" id="period" name="period" data-ng-model="realm.otpPolicyPeriod">
            </div>
            <kc-tooltip>How many seconds should an OTP token be valid? Defaults to 30 seconds.</kc-tooltip>
        </div>


        <div class="form-group" data-ng-show="access.manageRealm">
            <div class="col-md-10 col-md-offset-2">
                <button kc-save data-ng-disabled="!changed">Save</button>
                <button kc-reset data-ng-disabled="!changed">Cancel</button>
            </div>
        </div>
    </form>

</div>


<kc-menu></kc-menu>
