[jboss-user] [JBoss Seam] - Re: Security: Login twice after logout

thejavafreak do-not-reply at jboss.com
Wed Jan 30 02:58:18 EST 2008


"shane.bryzak at jboss.com" wrote : I've never seen anything like this happen.  Can you post your code?

The link for logging out:
		<s:link view="/login.xhtml" action="#{identity.logout}"
  | 			value="#{messages['logout']}" rendered="#{identity.loggedIn}" />
  | 
When I click this link and successfully logged out, I must log in twice. And this occurs everytime.

login.xhtml

  | 	<h:form id="login">
  | 
  | 		<rich:panel>
  | 			<f:facet name="header">
  | 				<h:outputText value="#{messages['login']}" />
  | 			</f:facet>
  | 
  | 			<h:panelGrid columns="2" rowClasses="prop"
  | 				columnClasses="name,value">
  | 				<h:outputLabel for="username">
  | 					<h:outputText value="#{messages['username']}" />
  | 				</h:outputLabel>
  | 				<h:inputText id="username" value="#{identity.username}" />
  | 				<h:outputLabel for="password">
  | 					<h:outputText value="#{messages['password']}" />
  | 				</h:outputLabel>
  | 				<h:inputSecret id="password" value="#{identity.password}" />
  | 				<h:outputLabel for="rememberMe">
  | 					<h:outputText value="#{messages['rememberMe']}" />
  | 				</h:outputLabel>
  | 				<h:selectBooleanCheckbox id="rememberMe"
  | 					value="#{identity.rememberMe}" />
  | 
  | 				<h:panelGroup></h:panelGroup>
  | 				<h:panelGroup>
  | 					<a4j:commandButton value="#{messages['login']}"
  | 						action="#{identity.login}" />
  | 				</h:panelGroup>
  | 			</h:panelGrid>
  | 
  | 		</rich:panel>
  | 
  | 	</h:form>
  | 

Authenticator.java

  | @Name("authenticator")
  | public class Authenticator implements Serializable
  | {
  | 	private static final long serialVersionUID = -5653442272412908470L;
  | 
  | 	@Logger Log log;
  |     
  |     @In Identity identity;
  |    
  |     public boolean authenticate()
  |     {
  |         log.info("authenticating #0", identity.getUsername());
  |         //write your authentication logic here,
  |         //return true if the authentication was
  |         //successful, false otherwise
  |         identity.addRole("admin");
  |         return true;
  |     }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124674#4124674

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124674



More information about the jboss-user mailing list