@Audit(action = AuditableActions.SAVE_CONSENT,
        actionResolverName = AuditActionResolvers.SAVE_CONSENT_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.SAVE_CONSENT_RESOURCE_RESOLVER)
    @Override
    public ConsentDecision storeConsentDecision(final Service service,
                                                final RegisteredService registeredService,
                                                final Authentication authentication,
                                                final long reminder,
                                                final ChronoUnit reminderTimeUnit,
                                                final ConsentReminderOptions options) throws Throwable {
        val attributes = resolveConsentableAttributesFrom(authentication, service, registeredService);
        attributes.replaceAll((key, value) -> {
            var attr = CasConsentableAttribute.builder()
                .name(key)
                .values(value)
                .build();

            for (val builder : this.consentableAttributeBuilders) {
                LOGGER.trace("Preparing to build consentable attribute [{}] via [{}]", attr, builder.getName());
                attr = builder.build(attr);
                LOGGER.trace("Finalized consentable attribute [{}]", attr);
            }
            return attr.getValues();
        });

        val principalId = authentication.getPrincipal().getId();
        val decisionFound = findConsentDecision(service, registeredService, authentication);
        val supplier = FunctionUtils.doIfNull(decisionFound,
            () -> consentDecisionBuilder.build(service, registeredService, principalId, attributes),
            () -> consentDecisionBuilder.update(decisionFound, attributes));

        val decision = supplier.get();
        decision.setOptions(options);
        decision.setReminder(reminder);
        decision.setTenant(service.getTenant());
        decision.setReminderTimeUnit(reminderTimeUnit);
        return consentRepository.storeConsentDecision(decision);
    }
This is {@link DefaultConsentEngine}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-consent-core/src/main/java/org/apereo/cas/consent/DefaultConsentEngine.java