Reputation: 71
I am tring to connect Lotus Notes(8.5.1) database (with Editor access as default in database ACL) from my Java web application. I follow this instruction http://www.ibm.com/developerworks/lotus/library/ls-Java_access_2/ to connect Lotus notes database remotely through CORBA DIIOP. basically I added NCSO.jar to my java path of eclipse, and set the server document as mentioned in the instruction. This is my java source codes from start: import lotus.domino.*; public class CORBAconnect {
public static void main(String[] args) {
try {
String host = "devs2:63148";
Session s = NotesFactory.createSession(host);
//I also tried this with userid and password below, the userid and password is not valid.
//Session s = NotesFactory.createSession(host, "jsmith", "js4533");//
String p = s.getCommonUserName();
System.out.println(p);
Database db = s.getDatabase("devs2", "apps/dev/market.nsf");
System.out.println(db.getFilePath() );
} catch(Exception e) {
e.printStackTrace();
}
}
}
after I ran the java codes, I can see the Anonymous is printed on the eclipse console, but I got NotesException: User Anomynous cannot open database error. I also tried to add my userid and password, but I got NotesException: Invalid user name/password. I also see somebody posted the same problem, but not solution yet. By the way, the DIIOP tab on the server document on Domino directory has Anonymous option set to Yes, Can anybody help how to make the connection working? ideally, I do not want to add userid and password on createSession. But if there is no options, then I will use, but now, with or without userid and password are not working. please let me know if there is anywhere I should setup on domino server part or java part. thanks
Upvotes: 0
Views: 2702
Reputation: 1557
Anonymous is a predefined user in domino. It is used from different processes like:
The user anonymous is like any other user:
On most domino servers the anonymous user has access to a whole lot of databases and has not less privileges than an ordinary user.
In your case a functional user with password is much better! Because the anonymous user doesn't have less privileges than a functional user. But the password from the functional user is a little protection, even if you have to put the password in an unsafe environment like a static string in a java jar. A possible attacker has to find the password and does not have the same rights without any password (anonymous).
I would not recommend to add anonymous in "Run restricted Java/javascript/COM". Only admins and signer ID's should have this privilege.
Upvotes: 2