<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
    <h1><strong>Settings</strong> {{realm.realm|capitalize}}</h1>

    <kc-tabs-realm></kc-tabs-realm>

    <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
        <fieldset class="border-top">
            <div class="form-group input-select">
                <label class="col-md-2 control-label" for="ssoSessionIdleTimeout">SSO Session Idle Timeout</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1"
                                   max="31536000" data-ng-model="realm.ssoSessionIdleTimeout"
                                   id="ssoSessionIdleTimeout" name="ssoSessionIdleTimeout"/>
                            <select class="form-control" name="ssoSessionIdleTimeoutUnit" data-ng-model="realm.ssoSessionIdleTimeoutUnit" >
                                <option data-ng-selected="!realm.ssoSessionIdleTimeoutUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Time a session is allowed to be idle before it expires.  Tokens and browser sessions are invalidated when a session is expired.</kc-tooltip>
            </div>
            <div class="form-group input-select">
                <label class="col-md-2 control-label" for="ssoSessionMaxLifespan">SSO Session Max Lifespan</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1"
                                   max="31536000" data-ng-model="realm.ssoSessionMaxLifespan"
                                   id="ssoSessionMaxLifespan" name="ssoSessionMaxLifespan"/>
                            <select class="form-control" name="ssoSessionMaxLifespanUnit" data-ng-model="realm.ssoSessionMaxLifespanUnit" >
                                <option data-ng-selected="!realm.ssoSessionMaxLifespanUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Max time before a session is expired.  Tokens and browser sessions are invalidated when a session is expired.</kc-tooltip>
            </div>
            <div class="form-group input-select">
                <label class="col-md-2 control-label" for="accessTokenLifespan">Access Token Lifespan</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1"
                                   max="31536000" data-ng-model="realm.accessTokenLifespan"
                                   id="accessTokenLifespan" name="accessTokenLifespan"/>
                            <select class="form-control" name="accessTokenLifespanUnit" data-ng-model="realm.accessTokenLifespanUnit" >
                                <option data-ng-selected="!realm.accessTokenLifespanUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Max time before an access token is expired.  This value is recommended to be short relative to the SSO timeout.</kc-tooltip>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="accessCodeLifespan">Client login timeout</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1" max="31536000" data-ng-model="realm.accessCodeLifespan" id="accessCodeLifespan" name="accessCodeLifespan">
                            <select class="form-control" name="accessCodeLifespanUnit" data-ng-model="realm.accessCodeLifespanUnit">
                                <option data-ng-selected="!realm.accessCodeLifespanUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Max time an client has to finish the access token protocol.  This should normally be 1 minute.</kc-tooltip>                </div>
            <div class="form-group input-select">
                <label class="col-md-2 control-label" for="accessCodeLifespanLogin" class="two-lines">Login lifespan</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1" max="31536000" data-ng-model="realm.accessCodeLifespanLogin" id="accessCodeLifespanLogin" name="accessCodeLifespanLogin">
                            <select class="form-control" name="accessCodeLifespanLoginUnit" data-ng-model="realm.accessCodeLifespanLoginUnit">
                                <option data-ng-selected="!realm.accessCodeLifespanLoginUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Max time a user has to complete a login.  This is recommended to be relatively long.  30 minutes or more.</kc-tooltip>
            </div>
            <div class="form-group input-select">
                <label class="col-md-2 control-label" for="accessCodeLifespanUserAction" class="two-lines">Login user action lifespan</label>
                <div class="col-sm-5">
                    <div class="row">
                        <div class="col-md-6 form-inline">
                            <input class="form-control" type="number" required min="1" max="31536000" data-ng-model="realm.accessCodeLifespanUserAction" id="accessCodeLifespanUserAction" name="accessCodeLifespanUserAction">
                            <select class="form-control" name="accessCodeLifespanUserActionUnit" data-ng-model="realm.accessCodeLifespanUserActionUnit">
                                <option data-ng-selected="!realm.accessCodeLifespanUserActionUnit">Seconds</option>
                                <option>Minutes</option>
                                <option>Hours</option>
                                <option>Days</option>
                            </select>
                        </div>
                    </div>
                </div>
                <kc-tooltip>Max time a user has to complete login related actions like update password or configure totp.  This is recommended to be relatively long.  5 minutes or more.</kc-tooltip>
            </div>
        </fieldset>

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

<kc-menu></kc-menu>