• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PolicyContext in Tomcat not being set in Tomcat 6.0.44

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic