use of org.gluu.config.oxtrust.LdapOxPassportConfiguration in project oxTrust by GluuFederation.
the class PassportRestWebService method getPassportConfig.
@GET
@Produces({ MediaType.APPLICATION_JSON })
@ProtectedApi
public Response getPassportConfig() {
Status status;
String jsonResponse;
try {
Object obj = Optional.ofNullable(passportService.loadConfigurationFromLdap()).map(LdapOxPassportConfiguration::getPassportConfiguration).map(Object.class::cast).orElse(Collections.emptyMap());
jsonResponse = jsonService.objectToPerttyJson(obj);
status = Status.OK;
} catch (Exception e) {
jsonResponse = "Failed to prepare configuration: " + e.getMessage();
status = Status.INTERNAL_SERVER_ERROR;
log.error(e.getMessage(), e);
}
log.trace("Passport endpoint config response is\n{}", jsonResponse);
return Response.status(status).entity(jsonResponse).build();
}
Aggregations