@Override
    public AuthorizationDecision check(final Supplier authentication, final RequestAuthorizationContext context) {
        val remoteAddr = StringUtils.defaultIfBlank(
            context.getRequest().getHeader(casProperties.getAudit().getEngine().getAlternateClientAddrHeaderName()),
            context.getRequest().getRemoteAddr());

        val granted = properties.getRequiredIpAddresses()
            .stream()
            .anyMatch(pattern -> RegexUtils.matchesIpAddress(pattern, remoteAddr));
        if (!granted) {
            LOGGER.warn("Provided regular expression or IP/netmask [{}] does not match [{}]",
                properties.getRequiredIpAddresses(), remoteAddr);
        }
        return new AuthorizationDecision(granted);

    }
This is {@link IpAddressAuthorizationManager}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-webconfig/src/main/java/org/apereo/cas/web/security/authentication/IpAddressAuthorizationManager.java