Fix the createSecurityComponents method in order to return the right object when LDAP is activated.