use of org.gluu.oxtrust.model.OxTrustedIdp in project oxTrust by GluuFederation.
the class TrustedIDPService method getTrustedIDPByRemoteIdpHost.
public OxTrustedIdp getTrustedIDPByRemoteIdpHost(String remoteIdpHost, String... returnAttributes) {
log.debug("Getting user information from DB: TrustedIDP = {}", remoteIdpHost);
OxTrustedIdp oxTrustedIdp = null;
if (StringHelper.isEmpty(remoteIdpHost)) {
return null;
}
String gluuPassportConfigDn = getDnForTrustedIDP(null);
Filter gluuPassportConfigIdpHostFilter;
if (dataSourceTypeService.isSpanner(gluuPassportConfigDn)) {
gluuPassportConfigIdpHostFilter = Filter.createEqualityFilter("remoteIdpHost", StringHelper.toLowerCase(remoteIdpHost));
} else {
gluuPassportConfigIdpHostFilter = Filter.createEqualityFilter(Filter.createLowercaseFilter("remoteIdpHost"), StringHelper.toLowerCase(remoteIdpHost));
}
List<OxTrustedIdp> entries = persistenceEntryManager.findEntries(gluuPassportConfigDn, OxTrustedIdp.class, gluuPassportConfigIdpHostFilter, returnAttributes);
log.debug("Found {} entries for TrustedIDP = {}", entries.size(), remoteIdpHost);
if (entries.size() > 0) {
oxTrustedIdp = entries.get(0);
}
return oxTrustedIdp;
}
Aggregations