use of org.xdi.oxauth.model.config.BaseDnConfiguration in project oxAuth by GluuFederation.
the class ConfSerialization method claims.
@Test
public void claims() throws IOException {
final BaseDnConfiguration baseDn = new BaseDnConfiguration();
baseDn.setAppliance("ou=appliances,o=gluu");
baseDn.setPeople("ou=people,o=@!1111,o=gluu");
baseDn.setClients("ou=clients,o=@!1111,o=gluu");
baseDn.setScopes("ou=scopes,o=@!1111,o=gluu");
baseDn.setAttributes("ou=attributes,o=@!1111,o=gluu");
baseDn.setSessionId("ou=session,o=@!1111,o=gluu");
final StaticConfiguration c = new StaticConfiguration();
c.setBaseDn(baseDn);
final String jsonStr = ServerUtil.createJsonMapper().writeValueAsString(c);
System.out.println(jsonStr);
}
use of org.xdi.oxauth.model.config.BaseDnConfiguration in project oxAuth by GluuFederation.
the class InumGenerator method baseDn.
public String baseDn(IdType p_type) {
final BaseDnConfiguration baseDn = staticConfiguration.getBaseDn();
switch(p_type) {
case CLIENTS:
return baseDn.getClients();
case APPLIANCE:
return baseDn.getAppliance();
case ATTRIBUTE:
return baseDn.getAttributes();
case PEOPLE:
return baseDn.getPeople();
}
// if not able to identify baseDn by type then return organization baseDn, e.g. o=gluu
try {
// baseDn.getClients(), e.g. ou=clients,o=@!1111,o=gluu
final DN dnObj = new DN(baseDn.getClients());
final RDN[] rdns = dnObj.getRDNs();
final RDN rdn = rdns[rdns.length - 1];
return rdn.toNormalizedString();
} catch (LDAPException e) {
log.error(e.getMessage(), e);
}
log.error("Use fallback DN: o=gluu, for ID generator, please check oxAuth configuration, clientDn must be valid DN");
return "o=gluu";
}
Aggregations