I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My
Java version in jdk1.6.0_45.
I am using Jaas Realm for Authentication. My authentication is working well but when I tried to get HttpServletRequest object from javax.security.jacc.PolicyContext in login() method of my Custom Login class which extends javax.security.auth.spi.LoginModule by below code:
, I am getting below error:
“javax.security.auth.login.LoginException: java.lang.IllegalArgumentException: unknown handler key at javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)”
When I printed
, it is returning null
and
returning Blank array.
I have already set jaas.config and configuration in context.xml. My question is : Do I need to set PolicyContext explicitly in
Tomcat ? If yes , how?
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.security.jacc</groupId>
<artifactId>javax.security.jacc-api</artifactId>
<version>1.4</version>
</dependency>