Search in sources :

Example 1 with PasswordResetTokenCipherExecutor

use of org.apereo.cas.pm.PasswordResetTokenCipherExecutor in project cas by apereo.

the class PasswordManagementConfiguration method passwordManagementCipherExecutor.

@ConditionalOnMissingBean(name = "passwordManagementCipherExecutor")
@RefreshScope
@Bean
public CipherExecutor passwordManagementCipherExecutor() {
    final PasswordManagementProperties pm = casProperties.getAuthn().getPm();
    final EncryptionJwtSigningJwtCryptographyProperties crypto = pm.getReset().getCrypto();
    if (pm.isEnabled() && crypto.isEnabled()) {
        return new PasswordResetTokenCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg());
    }
    return CipherExecutor.noOp();
}
Also used : PasswordManagementProperties(org.apereo.cas.configuration.model.support.pm.PasswordManagementProperties) PasswordResetTokenCipherExecutor(org.apereo.cas.pm.PasswordResetTokenCipherExecutor) 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 PasswordManagementProperties (org.apereo.cas.configuration.model.support.pm.PasswordManagementProperties)1 PasswordResetTokenCipherExecutor (org.apereo.cas.pm.PasswordResetTokenCipherExecutor)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