ApplicationPolicy ap = SecurityConfiguration.getApplicationPolicy("test");
MappingModuleEntry mme = new MappingModuleEntry(LdapAttributeMappingProvider.class.getName());
String attributeList = "mail,cn,commonname,givenname,surname,employeeType," +
"employeeNumber,facsimileTelephoneNumber";
mme.add(new ModuleOption("bindDN",this.adminDN));
mme.add(new ModuleOption("bindCredential",this.adminPW));
mme.add(new ModuleOption("baseFilter","(uid={0})"));
mme.add(new ModuleOption("java.naming.provider.url", "ldap://" + serverHost + ":" + port));
mme.add(new ModuleOption("baseCtxDN", "ou=People,dc=jboss,dc=org"));
mme.add(new ModuleOption("attributeList", attributeList));
MappingInfo attributeMappingInfo = new MappingInfo();
attributeMappingInfo.add(mme);
ap.setMappingInfo(MappingType.ATTRIBUTE.name(),attributeMappingInfo);