Search in sources :

Example 1 with AttributeReleaseConsentCipherExecutor

use of org.apereo.cas.consent.AttributeReleaseConsentCipherExecutor in project cas by apereo.

the class CasConsentCoreConfiguration method consentCipherExecutor.

@ConditionalOnMissingBean(name = "consentCipherExecutor")
@Bean
@RefreshScope
public CipherExecutor consentCipherExecutor() {
    final ConsentProperties consent = casProperties.getConsent();
    final EncryptionJwtSigningJwtCryptographyProperties crypto = consent.getCrypto();
    if (crypto.isEnabled()) {
        return new AttributeReleaseConsentCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg());
    }
    LOGGER.debug("Consent attributes stored by CAS are not signed/encrypted.");
    return CipherExecutor.noOp();
}
Also used : ConsentProperties(org.apereo.cas.configuration.model.support.consent.ConsentProperties) AttributeReleaseConsentCipherExecutor(org.apereo.cas.consent.AttributeReleaseConsentCipherExecutor) EncryptionJwtSigningJwtCryptographyProperties(org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

EncryptionJwtSigningJwtCryptographyProperties (org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties)1 ConsentProperties (org.apereo.cas.configuration.model.support.consent.ConsentProperties)1 AttributeReleaseConsentCipherExecutor (org.apereo.cas.consent.AttributeReleaseConsentCipherExecutor)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1