Custom user authentication in flowable

java.lang.ClassCastException: org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl cannot be cast to org.flowable.app.bean.CustomUser