1 Reply Latest reply on Mar 26, 2010 8:02 PM by Thomas Küstermann

    How to remove the case sensitive of the login?

    Nicolas U. Newbie

      Hi.


      I have implement standard seam authentification and my login is case sensitive.:


      /** name. */
      @NotNull
      @UserPrincipal // user principal permet de definir le "login" .
      private String userName;
       
      /** password. */
      @NotNull
      @UserPassword(hash = "MD5") // définit ce champ comme étant le mot de passe.
      private String passwordHash;



      and same stuff in xhtml:



        <h:form id="login"> 
          <rich:panel>  
          <f:facet name="header">Login</f:facet> 
          <p>Veuillez vous identifier.</p>  
           <div class="dialog">  
             <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value"> 
                <h:outputLabel for="username">Nom d'utilisateur:</h:outputLabel>  
                <h:inputText id="username" value="#{credentials.username}"/>  
                <h:outputLabel for="password">Password</h:outputLabel>  
                <h:inputSecret id="password" value="#{credentials.password}"/>  
             </h:panelGrid>  
           </div>  
         </rich:panel> 
         <div class="actionButtons">  
            <h:commandButton value="Login" action="#{identity.login}"/>  
         </div>  
         </h:form> 




      I can login me with user jean but i can't with JEAN or Jean


      How remove the case sensitive of the login? (i keep case sensitive the password)


      thx

        • 1. Re: How to remove the case sensitive of the login?
          Thomas Küstermann Newbie

          Hmm, interesting topic. If I look at the source code of class org.jboss.seam.security.Credentials I would install my own Crendentials component.


          The custom Credentials component would look like this:


          @Name("org.jboss.seam.security.credentials")
          @Scope(ScopeType.SESSION)
          @Install(Install.APPLICATION)
          @BypassInterceptors
          public class CustomCredentials extends Credentials {
              @Override
              public void setUsername(String username) {
                  super.setUsername(username == null ? null : username.toLowerCase());
              }
          }
          



          I don't know if this is the best solution, but it should work. Hope that helps!