I am using Laserfiche SDK 10.2 JRA to do development
I used the code like below for Kerberos login.
I have configured Kerberos configuration as directed by Laserfiche document.
Following is the sample of the code I used: with servername, repoName, username, password replaced.
---------------------------------------------------------------------------------------------------------------------
String serverName = "server IP", repoName = "repository name", userName = "user name", password = "user password";
System.setProperty("java.security.krb5.conf", "C:/Windows/krb5.ini");
System.setProperty("javax.security.auth.useSubjectCredsOnly","true");
System.setProperty("java.security.auth.login.config", "D:/LaserBeam/JRA-Security/jaas.conf");
System.setProperty("sun.security.krb5.debug","true");
Subject subject;
try {
LoginContext lc = new LoginContext("Client", new LoginCallbackHandler(userName, password));
lc.login(); <==== First Login
subject = lc.getSubject();
} catch (LoginException e) {
System.err.println(e.getMessage());
return;
}
int port = 80;
// Create a new session
Session session = new Session();
// Specify the repository to log in to
RepositoryRegistration repository = new RepositoryRegistration(serverName, repoName);
session.logIn(repository, subject); <== Second Login
------------------------------------------------------------------------------------------------------------
1) I found that the "First Login" was successful.
Can anybody tell me what I log into? Clearly, it is NOT laserfiche server.
What I am interested is to log into Laserfiche server.
But, the "First Login" was successful without specifying laserfiche server name or ip.
I did debug and found that although the 'First Login" is successful.
The property 'status" of "LoginContext lc " has value of false.
2) I found that 'Second Login" failed with a very long (almost one page) of error messages. Most of them are related to erros in Kerberos.
I think the "Second Login" is the one that actually trying to log into laserfiche server.
However, I do not know why it failed after successful log in of "First Login"/
3) Can anybody show me or tell me what value I should specify in serverName, RepoName, username, and password so that both logins can be successful?
Thanks