SeamSecurity Login Always fails
chadws May 12, 2008 7:58 PMI have been working on a simple application and want to add authentication to one of the pages. I have setup a JAAS Realm and can use container managed security to restrict access to one of the directories in the application so I know that I can authenticate against the Realm. However, whenever I attempt to secure the application with seam it always returns login failed.
I know that I am missing something simple, but for the life of me can not figure it out.
My pages.xml file contains the following:
<pages login-view-id="/login.xhtml">
<page view-id="/application/news/administration/index.xhtml" action="#{newsListingService.list}" />
<page view-id="/securityTest/*" login-required="true" />
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
<message>You must be logged in to perform this action.</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<end-conversation/>
<redirect view-id="/security_error.xhtml">
<message>You do not have the necessary security privileges to perform this action.</message>
</redirect>
</exception>
</pages>
I have the following in my components.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
<persistence:entity-manager-factory name="Website" />
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
entity-manager-factory="#{Website}" />
<core:init jndi-pattern="java:comp/env/website/#{ejbName}/local"/>
<security:identity remember-me="true"
jaas-config-name="file" />
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}" />
</event>
<event type="org.jboss.seam.security.postAuthenticate">
<action execute="#{redirect.returnToCapturedView}" />
</event>
</components>
If I make a request for he /securityTest/index.xhtml file I get presented with the login form, but it will not log me in. Has anyone seen this before or have any ideas what I should do to figure out what is going on?
I am using:
- seam 2.0.1.GA
- Glassfish v2ur2
Thanks