@Override
    public void populateAttributes(final AuthenticationBuilder builder, final AuthenticationTransaction transaction) {
        transaction.getPrimaryCredential().ifPresent(r -> {
            if (((RememberMeCredential) r).isRememberMe()) {
                LOGGER.debug("Credential is configured to be remembered. Captured this as [{}] attribute",
                    RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME);
                var rememberMe = true;
                val clientInfo = ClientInfoHolder.getClientInfo();
                if (clientInfo != null) {
                    if (StringUtils.isNotBlank(properties.getSupportedUserAgents()) && StringUtils.isNotBlank(properties.getSupportedIpAddresses())) {
                        rememberMe = RegexUtils.find(properties.getSupportedUserAgents(), clientInfo.getUserAgent())
                                     && RegexUtils.find(properties.getSupportedIpAddresses(), clientInfo.getClientIpAddress());
                    } else if (StringUtils.isNotBlank(properties.getSupportedUserAgents())) {
                        rememberMe = RegexUtils.find(properties.getSupportedUserAgents(), clientInfo.getUserAgent());
                    } else if (StringUtils.isNotBlank(properties.getSupportedIpAddresses())) {
                        rememberMe = RegexUtils.find(properties.getSupportedIpAddresses(), clientInfo.getClientIpAddress());
                    }
                }

                if (rememberMe) {
                    builder.addAttribute(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, Boolean.TRUE);
                }
            }
        });
    }
Determines if the credential provided are for Remember Me Services and then sets the appropriate
Authentication attribute if remember me services have been requested.

@author Scott Battaglia
@since 3.2.1
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/metadata/RememberMeAuthenticationMetaDataPopulator.java