change the logic to assign authentication flags differently as ldap comes before active_directory in the jaas-auth.conf.erb template