seam 2.1.2 flamingo 1.8.1
konikoni Jul 13, 2009 3:59 PMHello, maybe somebody can help me...
i'm using seam 2.1.2, flamingi 1.8.1, flex amf over seam remoting and jboss as 5.1.0.
All works fine until seam authentification, i can login and a get the event:
@Observer(JpaIdentityStore.EVENT_USER_AUTHENTICATED) public void loginSuccessful(UserAccount account) { log.info("user authentificated : " + account.getUsername()); Contexts.getSessionContext().set("authenticatedUser", account.getUser()); }
the log:
15:37:59,280 INFO [STDOUT] Hibernate: select useraccoun0_.ID as ID45_, useraccoun0_.ENABLED as ENABLED45_, useraccoun0_.PHASH as PHASH45_, useraccoun0_.USER_ID as USER5_45_, useraccoun0_.USERNAME as USERNAME45_ from USER_ACCOUNT useraccoun0_ where useraccoun0_.USERNAME=? limit ? 15:37:59,418 INFO [STDOUT] Hibernate: select user0_.ID as ID34_0_, user0_.ADDRESS as ADDRESS34_0_, user0_.FIRST_NAME as FIRST3_34_0_, user0_.LAST_NAME as LAST4_34_0_, user0_.PHONE as PHONE34_0_, user0_.TITLE as TITLE34_0_ from USER user0_ where user0_.ID=? 15:37:59,451 INFO [isys] user authentificated : admin1 <- JpaIdentityStore.EVENT_USER_AUTHENTICATED 15:37:59,452 INFO [STDOUT] Hibernate: select useraccoun0_.ID as ID45_, useraccoun0_.ENABLED as ENABLED45_, useraccoun0_.PHASH as PHASH45_, useraccoun0_.USER_ID as USER5_45_, useraccoun0_.USERNAME as USERNAME45_ from USER_ACCOUNT useraccoun0_ where useraccoun0_.USERNAME=? limit ? 15:37:59,463 INFO [STDOUT] Hibernate: select roles0_.ACCOUNT_ID as ACCOUNT1_1_, roles0_.ACCOUNT_OFF as ACCOUNT2_1_, userrole1_.ROLE_ID as ROLE1_4_0_, userrole1_.CONDITIONAL as CONDITIO2_4_0_, userrole1_.NAME as NAME4_0_ from ACCOUNT_USER_RELATION roles0_ left outer join USER_ROLE userrole1_ on roles0_.ACCOUNT_OFF=userrole1_.ROLE_ID where roles0_.ACCOUNT_ID=?
But if i try to acces to restrict componentents i get a not logged in exception, if test the context the identity is not logged in...
here is my components.xml, (that is concerned in META-INF ist it okay?)
<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.com/products/seam/components" xmlns:core="http://jboss.com/products/seam/core" xmlns:security="http://jboss.com/products/seam/security" xmlns:transaction="http://jboss.com/products/seam/transaction" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:persistence="http://jboss.com/products/seam/persistence" xsi:schemaLocation= "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-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"> <core:init jndi-pattern="tests/#{ejbName}/local" /> <!-- <core:init jndi-pattern="#{ejbName}/local" /> --> <!--<security:identity authenticate-method="#{authenticator.authenticate}"/> --> <core:manager conversation-timeout="120000" concurrent-request-timeout="500" conversation-id-parameter="cid"/> <!-- <transaction:entity-transaction entity-manager="#{entityManager}"/> --> <!-- <transaction:ejb-transaction/> --> <persistence:entity-manager-factory name="tests" installed="false"/> <!-- If Seam loads the persistence unit (JBoss 4.x), the EntityManagerFactory will be resolved from #{bookingDatabase}. On JBoss AS 5, the EntityManagerFactory is retrieved from JNDI (the binding occurs during application deployment). --> <persistence:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{tests}" persistence-unit-jndi-name="java:/testsEntityManagerFactory"/> <!-- JPA permission store --> <security:jpa-permission-store user-permission-class="com.tests.tests.domain.user.UserPermission" role-permission-class="com.tests.tests.domain.user.RolePermission"/> <security:jpa-identity-store user-class="com.tests.tests.domain.user.UserAccount" role-class="com.tests.tests.domain.user.UserRole"/> </components>
it tried with and without jpa-identity-store, the same result...