-
1. Re: Problem Deploying JBoss Client with WebStart
avsdude Mar 5, 2003 1:37 PM (in response to sheckler)The following code works for me:
Properties prop = System.getProperties();
ClassLoader classLoader = this.getClass().getClassLoader();
String file = classLoader.getResource("auth.conf").toString();
prop.setProperty("java.security.auth.login.config", file); -
2. Re: Problem Deploying JBoss Client with WebStart
avsdude Mar 5, 2003 1:52 PM (in response to sheckler)The following works for me:
Properties prop = System.getProperties();
ClassLoader classLoader = this.getClass().getClassLoader();
String file = classLoader.getResource("auth.conf").toString();
prop.setProperty("java.security.auth.login.config", file); -
3. Re: Problem Deploying JBoss Client with WebStart
petertje Mar 6, 2003 5:44 AM (in response to sheckler)What is wrong is that the sun implementation of the Jaas configuration class does not understand url's, it can only load 'normal' files.
I've run into the same trouble, also using webstart. I solved it by simply not using the sun configuration class, but my own (see attachment). This class lets you set the jaas configuration programmatically, which is very convenient in a webstart environment ;-).
The basic idea of Jaas that configuration of the login modules can be done _outside_ the application is violated by this solution, although that depends on how you implement it on the server of course. I cannot image a situation where the webstart user might want to change the login configuration (well, maybe he wants, but the system administrator won't let him ;-); you can still program it in such a way that the system adminstrator can change the login configuration on the server for webstart clients.
Hth,
Peter -
4. Re: Problem Deploying JBoss Client with WebStart
sheckler Mar 12, 2003 8:42 AM (in response to sheckler)My workaround is the follwing: extracting the file from the jar temporaryly and setting the property - this works with webstart (you need ofcourse to sign the jars to get write permission on the local pc)
try {
File file = new File("auth.conf");
PrintWriter out = new PrintWriter(new FileWriter(file));
String line;
System.out.println("Reading login configuration from " + cl.getResource("de/psi/cmd/psi_auth.conf").getPath());
BufferedReader in =
new BufferedReader(
new InputStreamReader(
cl.getResourceAsStream("de/psi/cmd/psi_auth.conf")));
while((line = in.readLine()) != null) {
out.println(line);
}
out.close();
in.close();
System.setProperty("java.security.auth.login.config", "auth.conf");
} catch (Exception e) {
System.err.println("Error setting System.property: " + e.getMessage());
}