-
1. Re: Custom Login
sradford Aug 7, 2003 8:43 AM (in response to andyjeff)Do you mean org.jboss.security.auth.spi.AbstractServerLoginModule ?
-
2. Re: Custom Login
andyjeff Aug 7, 2003 8:55 AM (in response to andyjeff)Yes that is what I meant :-) Why should I *have to* extend that or one of its subclasses ? Why can't i just extend javax.security.auth.spi.LoginModule and stick to pure JAAS (that can be used in a different EJB container) rather than JBoss JAAS (that can't) ?
-
3. Re: Custom Login
sradford Aug 7, 2003 4:37 PM (in response to andyjeff)Who said that you 'have' to? You can just create your own class that implements LoginModule...
-
4. Re: Custom Login
andyjeff Aug 7, 2003 11:26 PM (in response to andyjeff)Well all documentation suggests this (the JAAS howto doc for starters), and many posts on this forum suggest this.
I had already implemented my own LoginModule extending javax.security.auth.spi.LoginModule. I put it in a JAR and put it in $JBOSS_HOME/server/default/lib/. I then reference it in $JBOSS_HOME/server/default/conf/login-config.xml for a web application, as follows
<application-policy name="MyDBRealm">
<login-module code="mydomain.JAAS.DBLoginModule" flag="required" -->
<module-option name="dsJndiName">java:/DefaultDS</module-option>
<module-option name="principalsQuery">
SELECT Password FROM User WHERE Username=?</module-option>
<module-option name="rolesQuery">
SELECT Role, 'Roles' FROM UserRole WHERE Username=?</module-option>
</login-module>
</application-policy>
When I try to log in I get
2003-08-08 06:07:06,828 DEBUG [org.jboss.security.plugins.JaasSecurityManager.MyDBRealm] Login failure
javax.security.auth.login.LoginException: No LoginModules configured for MyDBRealm
How do these LoginModule's get configured for use in JBoss ?
If I swapped the login-module above for JBoss's DatabaseServerLoginModule it works - however I don't want to do that :-( -
5. Re: Custom Login
andyjeff Aug 11, 2003 10:51 AM (in response to andyjeff)I can only interpret the lack of a response here as acceptance that I have to extend the JBoss jaas AbstractServerLoginModule - the comments in the source file for that module implies it also. It would be nice to have that confirmed or otherwise - surely someone has an example of *not* extending the JBoss base LoginModule and its use in JBoss ?
-
6. Re: Custom Login
sradford Aug 11, 2003 4:08 PM (in response to andyjeff)Hmm... I don't quite see how not gettting a response during a weekend any acceptance of that at all - some of us get out and about at w/e's.
I suggest you debug your code a little... Is your login module getting instantiated and initialised for instance.