}
}
private void handlePAssertedAuthentication(SipServletRequest request) throws IOException {
PAssertedAuthenticatorFactory paf = PAssertedAuthenticatorFactory.getInstance();
PAssertedAuthenticator auth = null;
if (trustConfigId == null || trustConfigId.length() == 0) {
auth = (PAssertedAuthenticator) paf.getAuthenticator();
} else {
auth = (PAssertedAuthenticator) paf.getAuthenticator(trustConfigId);
}
if (auth == null) {
throw new SecurityException("P-Asserted Authenticator not configured");
}
TargetTuple remoteHost = ((SipServletRequestImpl) request).getInitialRemote();
String host = "";
if (remoteHost != null) {
host = remoteHost.getIP();
}
Principal authPrincipal = auth.authenticate(request, host,
identityAuthRealm, auth.INTERMEDIATE);
if (authPrincipal != null) {
((SipServletRequestImpl) request).setUserPrincipal(authPrincipal);
((SipServletRequestImpl) request).setUser(authPrincipal.getName());
} else {