[Security & JAAS/JBoss] - Password is changed after login
by atamur
I needed permanent login feature for my web app.
I did it as follows:
Created login module PermanentLoginModule that authenticates user over special table in db (user_id, secret). After usual authntication by username and pasword, if a special checkbox was checked a cookie with secret is stored in user`s browser and this secret is also stored in db.
When this user comes back my login.jsp forwards user to j_security_check with user_id as name and secret as password. Then, request gets into PermanentLoginModule and user is authenticated. As a security preventive measures this secret is immediatly changed to a new one.
Well, until now looks pretty logical =)
But than I got a serious problem. AFAIU the root of the problem is that Jboss stores inside credentials entered by user (user_id and out of date secret) and after 30 minutes, when internal cache expires it tries to test this credentials over db. And it fails, because user already has new secret.
So. This is my problem (if someone got to this point =)).
Please tell me, what can be done?
And maybe, just maybe I'm wrong and jboss doesn't store entered credentials ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969666#3969666
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969666
19 years, 7 months
[EJB 3.0] - NOTYETINSTALLED + JBoss-4.0.4.GA + dependency
by lpiccoli
hi all,
just migrated to Jboss 4.0.4GA. And my app is failing to deploy with the following error.
| ObjectName: jboss.j2ee:ear=asset.ear,jar=business.ejb3,name=ReportBean,service=E
| JB3
| State: NOTYETINSTALLED
| I Depend On:
| persistence.units:unitName=as
|
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: persistence.units:unitName=as
| State: NOTYETINSTALLED
| Depends On Me:
| jboss.j2ee:ear=asset.ear,jar=business.ejb3,name=AssetBean,service=EJB3
| jboss.j2ee:ear=asset.ear,jar=business.ejb3,name=DepreciationBean,service=EJB
| 3
| jboss.j2ee:ear=asset.ear,jar=business.ejb3,name=JobBean,service=EJB3
| jboss.j2ee:ear=asset.ear,jar=business.ejb3,name=ReportBean,service=EJB3
|
OK so i gather from the forum that JBoss4.0.4 is stricter on the dependancy checking. I have seen a work around for EJB injection using the @ignoreDependency but nothing for EntityManagers.
My code is
|
| @Stateless
| public class JobBean implements Job {
|
| @PersistenceContext (unitName="as")
| protected EntityManager em;
|
I have seen many request on the same topics but no solutions. If there is a solution please point it out so it wont be asked again.
thanks
-lp
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969663#3969663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969663
19 years, 7 months
[JBoss Portal] - Re: i18n problem
by Antoine_h
the default feature may have a bug or has no been tested yet with the use of chinese characters. but before : make sure of that : What is the exception ? what do it say ?
may be, to work around, you can set the title in the portlet code, instead of using the default feature provide with jboss portal (that takes it from the descriptor and put it in the title).
the code method is response.setTitle("my_title");
(in the doView method)
if you want to be able to change this title from the descriptor (and not modify the code each time you want to change it), then you can use in the portlet code a value that is taken from :
- the resource bundle related to the portlet : you set the title in a property that you get when you do the setTitle method. (see the example in the user document. If I remember well, there is a resource bundle example with the title defined in this file.
- an init-parameter of the portlet. The same way, you get it in the code and set the title with it.
feel free to ask more details if this is not clear or not compliant with what you want to do.
I am working on a i18n portal. Now it will be english and french, but I will have to make the chinese version... sooner or later.
I build it from the begining to be able to be translated in chinese (and many languages).
so any other problem you may encounter are welcome to know and see if I can help to solve it : I can see in advance what won't be easy when adding the chinese version.
Talking in the forum is better for sharing the experience. if needed, you can also contact me : http://www.sysemo.com/Sysemo-consultant-Antoine-Herzog.php
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969661#3969661
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969661
19 years, 7 months
[JBoss Seam] - Re: Seam-managed persistence context set-up in Tomcat - help
by Cvirko
I want to use JPA with Hibernate, Seam, JSF RI 1.2 Facelets and Tomcat. I want to use JavaBean, no Session Beans. I have everything set up. I am just struggling with Persistence Context. My persistence.xml is
<persistence>
| <persistence-unit name="fossEntityManager">
| <provider>org.hibernate.ejb.HibernatePersistences</provider>
| <jta-data-source>java:/fossDatasource</jta-data-source>
| <properties>
| <property name="hibernate.show_sql" value="true"/>
| </properties>
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/fossEntityManagerFactory"/>
| </persistence-unit>
| </persistence>
|
My components.xml file is
<components>
| <component name="org.jboss.seam.core.init">
| <property name="myFacesLifecycleBug">false</property>
| <property name="jndiPattern">#{ejbName}/local</property>
| </component>
|
| <component class="org.jboss.seam.core.Microcontainer" installed="true"/>
|
| <component name="org.jboss.seam.core.init.managedPersistenceContexts">fossEntityManager</component>
|
| <component class="org.jboss.seam.core.Ejb" installed="true"/>
|
| <!-- Added Seam-managed persistence context -->
| <component name="fossEntityManager"
| class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/fossEntityManagerFactory</property>
| </component>
| </components>
|
I even added
<component name="org.jboss.seam.core.init.managedPersistenceContexts">fossEntityManager</component>
And then in my JavaBean class I have following line
@In(create=true) EntityManager fossEntityManager;
and I am still getting error:
java.lang.IllegalArgumentException: EntityManagerFactory not found
| ...
| Caused by: javax.naming.NameNotFoundException: fossEntityManagerFactory not bound
|
What am I doing wrong. I though that microcontainer would take care of JNDI mapping. Where else am I suposed to register EntityManagerFactory?
I was using
Perstince.createEntityManagerFactory(
| "fossEntityManager")
and it worked fine. However, I would like to use Seam-managed PC. Any help appreciated. Thanks
Tomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969657#3969657
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969657
19 years, 7 months