Map<String, String> realm = endpoint.getRestletRealm();
if (realm != null && realm.size() > 0) {
ChallengeAuthenticator guard = new ChallengeAuthenticator(component.getContext()
.createChildContext(), ChallengeScheme.HTTP_BASIC, "Camel-Restlet Endpoint Realm");
MapVerifier verifier = new MapVerifier();
for (Map.Entry<String, String> entry : realm.entrySet()) {
verifier.getLocalSecrets().put(entry.getKey(), entry.getValue().toCharArray());
}
guard.setVerifier(verifier);
guard.setNext(target);
target = guard;
LOG.debug("Target has been set to guard: {}", guard);