I am trying to create a simple webapp (war) that uses an internal custom
JAAS LoginModule to authenticate users, this solution has to work in
Tomcat/JBoss/WebSphere.  I thought Spring might be a natural fit to provide
a generic solution.

I have been reading the Spring docs (
http://static.springframework.org/sp...html/jaas.html<http://static.springframework.org/spring-security/site/reference/html/jaas.html>)
to learn how to use spring security and to begin all was going well.
However when I get to chapter 15 which explains JAAS things are not working
for me anymore.  I suspect the problem is that in this chapter the examples
are too brief and leave a lot implied.  What I am looking for is basic info
on how to configure my applicationContext.xml to use Spring/JAAS.

Here is what I have so far:
<beans xmlns="http://www.springframework.org/schema/beans";
...
<bean id="jaasAuthenticationProvider"

class="org.springframework.security.providers.jaas.JaasAuthenticationProvider">
        <security:custom-authentication-provider />

        <property name="loginConfig" value="/WEB-INF/login.conf"/>
        <property name="loginContextName" value="WebTAS_JAAS"/>
        <property name="callbackHandlers">
            <list>
                <bean
class="org.springframework.security.providers.jaas.JaasNameCallbackHandler"/>
                <bean
class="org.springframework.security.providers.jaas.JaasPasswordCallbackHandler"/>
            </list>
        </property>
        <property name="authorityGranters">
            <list>
                <bean class="com.issinc.cdf.servlet.TestAuthorityGranter"/>
            </list>
        </property>
</bean>

<security:http auto-config='true'>
        <security:intercept-url pattern="/**" access="ROLE_USER"/>
        <security:http-basic/>
</security:http>

<security:authentication-provider>
        <!--What goes here???-->
</security:authentication-provider>

where the file at WEB-INF/login.conf specifies what custom LoginModule to
use.

This code fails upon JBoss loading this file.  I think the problem is that
the jaasAuthenticationProvider bean is not tied to the
authentication-provider but don't know for sure.

Any help is greatly appreciated.

-Dave

P.S. Also, I'm not sure what code should be in TestAuthorityGranter, I took
my best guess but this is not the cause of the current failure.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to