[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2165) Authenticator method invoked twice when login fails
by Yannick Lazzari (JIRA)
Authenticator method invoked twice when login fails
---------------------------------------------------
Key: JBSEAM-2165
URL: http://jira.jboss.com/jira/browse/JBSEAM-2165
Project: JBoss Seam
Issue Type: Bug
Components: Security
Affects Versions: 2.0.0.CR3
Reporter: Yannick Lazzari
Priority: Minor
The default behaviour of the isLoggedIn method in the Identity class is to pass the attemptLogin flag to true. Because of that, when authentication fails, it always calls the authenticator method twice. See the code of the authenticate() method below:
public void authenticate()
throws LoginException
{
// If we're already authenticated, then don't authenticate again
if (!isLoggedIn())
{
authenticate( getLoginContext() );
}
}
public boolean isLoggedIn(boolean attemptLogin)
{
if (!authenticating && attemptLogin && getPrincipal() == null && isCredentialsSet() &&
Contexts.isEventContextActive() &&
!Contexts.getEventContext().isSet(LOGIN_TRIED))
{
Contexts.getEventContext().set(LOGIN_TRIED, true);
quietLogin();
}
// If there is a principal set, then the user is logged in.
return getPrincipal() != null;
}
public void authenticate(LoginContext loginContext)
throws LoginException
{
try
{
authenticating = true;
preAuthenticate();
loginContext.login();
postAuthenticate();
}
finally
{
authenticating = false;
}
}
The first reference to isLoggedIn tries to log the user. When it fails, it goes in the if block and tries to authenticate the user for a second time before failing again. I could fix this on my end by overriding the isLoggedIn() method in my own Identity component and passing the attemptLogin flag to false. Before doing so, I thought that perhaps a fix could be done at a higher level, i.e. in the Identity class of Seam itself. The way I see it, 2 things could be done:
1. In the authenticate() method, invoke the isLoggedIn method with false.
2. Look into the management of the authenticating class member; there might be something wrong. It's only set to true at the beginning of the authenticate(LoginContext) method. If you look at the logic in the isLoggedIn(boolean) method, when it winds up being invoked at the beginning of the authenticate(), the authenticating flag is false, the attemptLogin flag is true, I don't have a principal yet (I'm trying to login for the first time) and my credentials are set (the user just provided his username and password).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2580) JPA-Session handling and Session Beans with scope=SESSION
by Cyrill Rᅢᄐttimann (JIRA)
JPA-Session handling and Session Beans with scope=SESSION
---------------------------------------------------------
Key: JBSEAM-2580
URL: http://jira.jboss.com/jira/browse/JBSEAM-2580
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.1.GA
Environment: MacOS X 10.5, Java 5 (Apple), Glassfish v2u1
Reporter: Cyrill Rᅢᄐttimann
Priority: Blocker
I have two session beans with scope=SESSION, the CustomerManager and the SportEquipmentManager. While accessing the sport equipments of a customer, I get a org.hibernate.LazyInitializationException at the method allSportEquipments():
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: yy.ddd.ttt.customer.domain.Customer.sportEquipments, no session or session was closed
@In(value = SeamConstants.NAME_ENTITYMANAGER)
private EntityManager mEntityManager;
@DataModel(value = "sportequipments")
private Set<SportEquipment> mSportEquipments;
@In(value = "customerManager", create = true)
private CustomerManager mCustomerManager;
private SportEquipmentType mCurrentSportEquipmentType;
@Factory("sportequipments")
public void allSportEquipments() throws PersistencyException {
final Customer customer = mCustomerManager.getCustomer();
mSportEquipments = customer.getSportEquipments();
}
The interesting thing is that this happens only, if I am accessing the SportEquipmentManager after using the CustomerManager. If I am acessing the SportEquipmentManager directly, I am not hit with the exception. Using the CustomerManger means, opening a page with access to the CustomerManager's method.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2576) Add attribute to @PerNestedConversation annotation type to allow disabling of inherited @PerNestedConversation behavior
by Wolfgang Schwendt (JIRA)
Add attribute to @PerNestedConversation annotation type to allow disabling of inherited @PerNestedConversation behavior
-----------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-2576
URL: http://jira.jboss.com/jira/browse/JBSEAM-2576
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.0.1.CR1
Environment: Seam 2.0.1.SNAPSHOT based on SVN trunk
Reporter: Wolfgang Schwendt
Priority: Minor
The definition of annotation type org.jboss.seam.annotations.PerNestedConversation is annotated with @Inherited. While inheritance of annotations can be comfortable, it has the drawback that every Seam component which subclasses/extends a Seam component annotated with @PerNestedConversation automatically inherits the @PerNestedConversation behavior.
Consequently, there is currently no easy way to disable the @PerNestedConversation setting for a Seam component (if one wants to do this for certain reasons). It is NOT possible to subclass a Seam component annotated with @PerNestedConversation in order to override that component and disable the @PerNestedConversation behavior.
Feature Request: it would be nice if an attribute could be added to the @PerNestedConversation annotation type to disable inheritance of the @PerNestedConversation behavior. The following example illustrates the idea:
@Name("org.jboss.seam.pageflow.pageflow") // override framework provided Pageflow component
@PerNestedConversation(disable=true) // disables @PerNestedConversation setting inherited from superclass org.jboss.seam.pageflow.Pageflow
@Install(dependencies="org.jboss.seam.bpm.jbpm", precedence=FRAMEWORK, classDependencies="javax.faces.context.FacesContext")
public class OverridingPageflowComponent extends org.jboss.seam.pageflow.Pageflow
{...
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2572) <s:formattedText> breaks rendering if there's no content between two formatting characters
by Kurt Edegger (JIRA)
<s:formattedText> breaks rendering if there's no content between two formatting characters
------------------------------------------------------------------------------------------
Key: JBSEAM-2572
URL: http://jira.jboss.com/jira/browse/JBSEAM-2572
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.CR2
Environment: Windows XP; Java 2.0.0.CR2; Seam 2.0.0.CR2; JBoss AS 4.2.0.GA
Reporter: Kurt Edegger
If there is no text between two formatting characters (*,|,/,...) of SeamText, rendering of the page fails because of an XML Parsing Error: mismatched tag. Expected: .
Example:
<!-- this one works great -->
<s:formattedText value="Hello, *this* is the text"/>
<!-- this one will break the rendering of the page where embedded -->
<s:formattedText value="Hello, ** is the text"/>
Obviously no one would write the such a formatting by hand, but it occurs, if there is a value binding to a property in a backing bean which is null (e.g.: <s:formattedText value="Hello, *#{user.name}* "/> and user.name==null).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1388) s:fileUpload doesn't work in Portlet
by jarkko Lietolahti (JIRA)
s:fileUpload doesn't work in Portlet
------------------------------------
Key: JBSEAM-1388
URL: http://jira.jboss.com/jira/browse/JBSEAM-1388
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 1.2.1.GA
Reporter: jarkko Lietolahti
>From UIFileUpload.java:
@Override
public void decode(FacesContext context)
{
super.decode(context);
ServletRequest request = (ServletRequest) context.getExternalContext().getRequest();
}
In portal/portlet, one gets ActionRequest (which extends PortalRequest) instead of ServletRequest.
Nested Exception is
java.lang.ClassCastException: com.liferay.portlet.ActionRequestImpl cannot be cast to javax.servlet.ServletRequest
at org.jboss.seam.ui.UIFileUpload.decode(UIFileUpload.java:35)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:606)
at javax.faces.component.UIForm.processDecodes(UIForm.java:53)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:135)
at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:219)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction(MyFacesGenericPortlet.java:220)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:333)
at com.liferay.portlet.CachePortlet.processAction(CachePortlet.java:157)
at com.liferay.portal.action.LayoutAction._processPortletRequest(LayoutAction.java:269)
at com.liferay.portal.action.LayoutAction._processActionRequest(LayoutAction.java:290)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:113)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:156)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:479)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:143)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter.doFilter(LayoutCacheFilter.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.doFilter(AutoLoginFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:169)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at net.hyperic.hq.product.servlet.filter.JMXFilter.doFilter(JMXFilter.java:277)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:619)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 11 months