Unfortunately, this mechanism don't works well when you implement a RIA (Rich Internet Application) and use AJAX call for authenticate users because your submit through XHR and not by html form submit.
I use a simple trick to show password store request from browser. After the AJAX login request complete, if the user is successful authenticate, submit the login form to a url that return a HTTP 204 status (204 NO CONTENT). The browser ask to save password but the user does not navigate anywhere else.
This is an example:
<form method="post" action="http://demo.utilities-online.info/backend/none">
Username: <input id="username" type="text" name="username"><br/>
Password: <input id="password" type="password" name="password"><br/>
<input type="button" value="login" onclick="sendRequest();">
</form>
try now!
Enjoy with AJAX!
Nessun commento:
Posta un commento