alternative to set "java.security.auth.login.config" ?

In all examples of using JASS, it uses the following way.

System.setProperty("java.security.auth.login.config", fileName)

Is there a way I can specify the policies in code, not in a file? That way I don't have to worry about file permissions.

p.s. Thanks for Seema-1 who anwsered my last question.

Message was edited by:

maqiang9111

[372 byte] By [maqiang9111a] at [2007-9-25]
# 1
I'm also interested in this. Anyone?
piorbya at 2007-7-15 > top of java,Security,Other Security APIs, Tools, and Issues...
# 2
Found it, I now use:URL url = MyClassName.class.getClassLoader().getResource("auth.conf");System.setProperty("java.security.auth.login.config", url.toExternalForm());auth.conf is placed in src/main/resources that maven will place in root of the jar file for me.
piorbya at 2007-7-15 > top of java,Security,Other Security APIs, Tools, and Issues...
# 3
I found the solution here: http://forum.java.sun.com/thread.jspa?threadID=727148&messageID=4188214
piorbya at 2007-7-15 > top of java,Security,Other Security APIs, Tools, and Issues...
# 4
Hey, thanks piorby. This is definitely better!
maqiang9111a at 2007-7-15 > top of java,Security,Other Security APIs, Tools, and Issues...
# 5

Has anyone done the same thing for the java.security.krb5.conf setting? I tried setting it using the same form of URL that I use for java.security.auth.login.config, and I get this error when the kerberos code attempts to use it:

Could not load configuration file jar:file:\C:\dev\workspace\myapp\client-data.jar!\krb5.ini (The filename, directory name, or volume label syntax is incorrect)

The corresponding login context conf file in the same jar loads fine.

ericsworda at 2007-7-15 > top of java,Security,Other Security APIs, Tools, and Issues...