How to display the number of available login attempts on the standard authorization page

Good day. I’m trying to display the maximum number of login attempts (Brute force detection) on the login page using the default theme. I did not find in the documentation information about the available objects that I can use in the template.

I tried to do various options for getting the value of the maximum number of login attempts:

<#assign failedLoginCount = request.getAttribute('javax.security.auth.login.failedLoginCount')?c>
<#assign realmName = authenticationFlowError?.realm?.name?c>
<#if realmName?exists>
     <p>Realm name: ${realmName}</p>
</#if>
<#assign authenticationFlowError = request.getAttribute('authenticationFlowError')?c>
<#if authenticationFlowError?has_content>
     <#assign dataModel = dataModel + {"authenticationFlowError": authenticationFlowError}>
</#if>
<#assign maxLoginFailures = realm.maxFailureLoginAttempts?c>
<#if maxLoginFailures?exists>
     <p>Maximum login failures: ${maxLoginFailures}</p>
</#if>

But in all cases, this resulted in the error “An internal server error has occurred”.

Tell me, please, is it possible to somehow get the value of the maximum number of available login attempts and the number of unsuccessful login attempts made at the moment?