timer.mark("reading");
for (ExternalIdentityRef ref: externalGroups) {
log.debug("- processing membership {}", ref.getId());
// get group
ExternalGroup extGroup;
try {
extGroup = (ExternalGroup) idp.getIdentity(ref);
} catch (ClassCastException e) {
// this should really not be the case, so catching the CCE is ok here.
log.warn("External identity '{}' is not a group, but should be one.", ref.getString());
continue;
} catch (ExternalIdentityException e) {
log.warn("Unable to retrieve external group '{}' from provider.", ref.getString(), e);
continue;
}
if (extGroup == null) {
log.warn("External group for ref '{}' could not be retrieved from provider.", ref);
continue;
}
log.debug("- idp returned '{}'", extGroup.getId());
Group grp;
try {
grp = (Group) userManager.getAuthorizable(extGroup.getId());
} catch (ClassCastException e) {
// this should really not be the case, so catching the CCE is ok here.
log.warn("Authorizable '{}' is not a group, but should be one.", extGroup.getId());
continue;
}
log.debug("- user manager returned '{}'", grp);
if (grp == null) {