The classcastexception does not occur in the CustomLoginModule. It occurs in a
servlet(spring controller) that has access to the httprequest object.
This means that the CustomPrincipal is located in 2 places. May be in your
WEB-INF/lib or WEB-INF/classes. Get rid of that. The jar containing
Also why do you have your login-config.xml have 2 entires as below ? Shouldn't
there be one entry ? Please also check your login Module to make sure you are
instantiating your CustomPrincipal as opposed to Jboss SimplePrincipal
module-option name=principalClassName
| xxx.xxx.CustomPrincipal
The extra module option was just experimination.A forum that I went to had
principalClassName instead of principalClass.
I was able to figure out my problem using the following URL:
http://www.jboss.org/community/docs/DOC-12517
Group customGroup = new SimpleGroup(CallerPrincipal);
Moving my LoginModule to a seperate JAR still does not work. I have one
correction. The classcastexception does not occur in the CustomLoginModule.
It occurs in a servlet(spring controller) that has access to the httprequest
object.
The following calls:
I packaged my custom Principal, lets call it, MyCustomPrincipal and
MyCustomLoginModule within the WAR file containing my web application. I
figured as long as it's in the class path it should be fine.
Within the MyCustomLoginModule when I call request.getPrincipal after
authentication and
Try this :- (1) JAR the following classes MyCustomPrincipal and
MyCustomLoginModule .
(2) Put the JAR in $HOME/server/default/lib.
(3) Modify the run.sh or run.bat to pick up this JAR in its classpath.
(4) Remove these classes from your WAR.
This way, the module and its customPrincipal are
ClassCastException implies that the class was loaded by different classloader.
and you are trying to cast a class loaded by different classloader..How did you
package and deploy the class ?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4185257#4185257
Reply to