<commit_before><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-show="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" required 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-show="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" required 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><commit_msg>[KEYCLOAK-2119] OTP Policy form validates both TOTP and HOTP at the same time<commit_after><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>
{'fraction_non_alphanumeric': 0.14825365370324498, 'fraction_numerical': 0.013871686896210057, 'mean_word_length': 2.0063291139240507, 'pattern_counts': {'":': 0, '<': 193, '<?xml version=': 0, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4944894', 'n_tokens_mistral': 2467, 'n_tokens_neox': 2342, 'n_words': 519}