flowable 賬號密碼加密


背景:

集成flowable的idm的時候,密碼總是明文,這種肯定不行。

實現

1.配置config

@Configuration
public class IdmProcessEngineConfiguration extends SpringIdmEngineConfiguration {

    @Bean
    public PasswordEncoder bCryptEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean
    public SpringEncoder passwordEncoder(){
        return new SpringEncoder(bCryptEncoder());
    }

    @Override
    public IdmEngineConfiguration setPasswordEncoder(org.flowable.idm.api.PasswordEncoder passwordEncoder) {
        return super.setPasswordEncoder(passwordEncoder());
    }
}

2.設置密碼

UserEntity userEntity = (UserEntity) idmIdentityService.createUserQuery().userId(id).singleResult();
if (null!=userEntity) {
     userEntity.setPassword(password);
     idmIdentityService.updateUserPassword(userEntity);
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM