couldn't add my jaas config file to the jdk/security/java.security

208 views Asked by At

so am trying to build a webapp with tomcat and jaas as authentication and my jaas config file is named as lord.config and when i try to add the path in java.security file which is located in JAVA_HOME/conf/security and try to run the web app it throws an error

java.lang.SecurityException: java.io.IOException: Configuration Error:
   No such file or directory

the path that i added in java.security is:

login.config.url.1=file:"C:\Program Files\Apache Software Foundation\testtc\webapps\testjaas\WEB-INF\classes\lord.config"

and this is the actual path of the lord.config from cmd

C:\Program Files\Apache Software Foundation\testtc\webapps\testjaas\WEB-INF\classes

the code of lord.config file

LorduJaas {
    LoLoginModule required;
};

and i tried adding and removing "" for spaces neither did work.. what should i to add my config file to the java.security file?

1

There are 1 answers

0
hariharan baskaran On BEST ANSWER

It seems for the path I need to change it to the other slash as it is considered as an escape sequence changing it did the magic as follows

login.config.url.1=file:"C:/Program Files/Apache Software Foundation/testtc/webapps/testjaas/WEB-INF/classes/lord.config"