0

Save username/password in login form

asked 2011-02-08 08:06:05 +0800

gizm0 gravatar image gizm0
33 1

I have the following login form:

<?page title="Translator"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"?>
<window title="${c:l('login.login')}" border="normal"
  width="500px" position="center" mode="overlapped">
  <h:form id="f" name="f" action="../j_spring_security_check" method="POST"
    xmlns:h="native">
    <grid>
      <rows>
        <row if="${not empty SPRING_SECURITY_LAST_EXCEPTION.message}">
          <label value="${c:l('login.failed')}:" />
          ${SPRING_SECURITY_LAST_EXCEPTION.message}
        </row>
        <row>
          ${c:l('login.user')}:
          <textbox id="u" name="j_username" />
        </row>
        <row>
          ${c:l('login.password')}:
          <textbox id="p" type="password" name="j_password" />
        </row>
        <row>
          ${c:l('login.remember')}:
          <checkbox id="r" name="_spring_security_remember_me" />
        </row>
        <row spans="2">
          <hbox pack="end" width="100%">
            <h:input type="reset" value="${c:l('button.reset')}" />
            <h:input type="submit" value="${c:l('login.login')}" />
          </hbox>
        </row>
      </rows>
    </grid>
  </h:form>
</window>
The problem is, that the browser does not remember the login credentials. Is there a way to make it work?

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2011-02-09 03:33:09 +0800

gizm0 gravatar image gizm0
33 1

Maybe I didn't explain it well. The browser seems not to recognize to form as login form and it doesn't ask me, if I want to save the login credentials.

link publish delete flag offensive edit

answered 2011-04-21 06:51:00 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

I have the same problem.
Any solution to this?

link publish delete flag offensive edit

answered 2011-04-21 07:33:21 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

I've tried different solutions in the past, but nothing worked, so I think that it's not possible to bring a browser to save login credentials for an Ajax-form. The browser doesn't recognize it properly. I would recommend to use a traditional HTML/JSP-based form and submit the values to your ZK-application which resolves the login.

Cheers, Maik

link publish delete flag offensive edit

answered 2011-04-21 09:51:55 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Damn,
thanks for your reply though Maik.

I guess it's time for some refactoring >:(

link publish delete flag offensive edit

answered 2011-04-21 10:06:10 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2011-04-21 10:06:24 +0800

Hmmmmm, only an idea.

You can underlay a zk controller. In the onCreateLoginWindow() you can pre-define the user/pwd textboxes from readout a cookie ?

best
Stephan

link publish delete flag offensive edit

answered 2011-04-21 12:39:17 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Hm, no bad idea.
If I understood you correctly, that would bypass the browser's password manager and instead set username and password and manually if a cookie exists.

link publish delete flag offensive edit

answered 2011-04-21 13:00:47 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2011-04-21 13:01:22 +0800

yes, it's pre-defined values for the textboxes from a cookie.

See the ZkLoginDialog.java and the zkloginDialog.zul in Zksample2. Delete not used stuff and add the cookie stuff in there.

link publish delete flag offensive edit

answered 2011-04-22 07:20:18 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Worked very nicely :-D
Thanks for the tip!

link publish delete flag offensive edit

answered 2011-09-14 16:06:11 +0800

zippy gravatar image zippy
504 1 2

push

I have the same problem
Any solution to this?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-08 08:06:05 +0800

Seen: 1,141 times

Last updated: Sep 14 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More