CHAPTER 9
Using APIs for Authentication
Login
Copyright © 2010, Juniper Networks, Inc.
This chapter shows how to use the NSM APIs to log into and log out of the system.
This chapter contains the following sections:
Login on page 95
Logout on page 96
This API sample code shows how to log into the NSM server.
/**
* Prerequisite:
*
* @throws Exception
*/
public void setUp() throws Exception {
if (PolicyAssignmentTest.setUpDone) return;
Properties properties = null;
webDir = System.getProperty("WEBDIR");
if (webDir == null) {
webDir = System.getProperty("user.dir") + File.separator + "..";
System.err.println("WEBDIR is not defined, using the default one " +
webDir);
}
File argsCandidate = new File(webDir + File.separator + "client" +
File.separator + "Properties.txt");
if (null != argsCandidate) {
properties = new Properties();
FileInputStream fin = new FileInputStream(argsCandidate);
properties.load(fin);
fin.close();
}
String trustStore = (String) properties.get("javax.net.ssl.trustStore");
String trustStorePath = webDir + File.separator + trustStore.replace('/',
File.separatorChar);
95
Need help?
Do you have a question about the NETWORK AND SECURITY MANAGER 2010.4 - API GUIDE REV 1 and is the answer not in the manual?
Questions and answers