Nortel Vpn Gateway; User Guide - Nortel NN46120-104 User Manual

Vpn gateway
Table of Contents

Advertisement

278 Using the Port Forwarder API
private String getCookieFromURL(String spec) {
try {
URL url = new URL(spec);
URLConnection connection = null;
((HttpURLConnection) connection).setFollowRedirects(false);
connection = url.openConnection();
connection.getInputStream();
/* check if we are authorized */
if (connection != null) {
+ 1,
} else {
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
PortForwarderAuthenticator pfa =
new PortForwarderAuthenticator() {
public PortForwarderCredentials getCredentials() {
}
public PasswordAuthentication getProxyCredentials() {
,
)
));
}
};
portForwarder.setAuthenticator(pfa);
Copyright © 2007-2008 Nortel Networks
.
String headerField =
getHeaderField(connection, SET_COOKIE_HEADER);
return headerField.substring (headerField.indexOf('=')
return null;
cookie = getCookieFromURL(loginUrl);
if (cookie == null) {
return null;
}
cred.setNortelToken(cookie);
return cred;
LoginDialog loginDialog = new LoginDialog();
return new PasswordAuthentication(loginDialog.getUserId()

Nortel VPN Gateway

NN46120-104 02.01 Standard
14 April 2008
headerField.indexOf(';'));
loginDialog.getPassword(

User Guide

.toCharArray(

Advertisement

Table of Contents
loading

Table of Contents