-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Raj Mettai escribió:
> I am also trying to authenticate users using URL parameters, if you don't 
> mind can you please share that javascript client side code ? 

On WEB-INF/view/jsp/default/ui/casLoginView.jsp, before the first <form>
tag, you can add this snippet of code:

- --8<--
<%
String auto = request.getParameter("auto");
if (auto != null && auto.equals("true")) {
%>
<script language="javascript">
 function doAutoLogin() {
  document.forms[0].username.value = '<%=request.getParameter("u")%>';
  document.forms[0].password.value = '<%=request.getParameter("p")%>';
  document.forms[0].submit();
 }
 addLoadEvent(doAutoLogin);
</script>
<%
}
%>
- --8<--

I'm passing 'u' and 'p' for the sake of distinction, but I'm filling the
username and password fields, only if the auto parameter is set to true.
Notice you will also need to change the <input type='submit'> name to
anything else than 'submit', otherwise you get Javascript errors.

This was posted in a blog entry somewhere by somebody else, I just had
to change the parameters being passed to u and p. Pass them via POST and
ideally using https. JSP views don't need a full Tomcat reload to work.

HTH,

- --
José Miguel Parrella Romero (bureado.com.ve)          PGP: 0×88D4B7DF
Debian Developer                                Caracas, VE/Quito, EC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJL2FR4AAoJEMAyQqmI1LfftuMP/1ZniiO2BTs0jRBGfgkh8N/K
3OnDneh7rJ2iSSKNUZ6DAH/jcVR7+zzkj5X7mnXC1//IM9zEdpt501YT51m6J1rg
aptXu/Js9LGPy4bUZoY6N/k1tpOly0Iu8DcLF7VWYNBtt6A/4ViGYWuYu3JW+gIP
YbE/tEY0sU8PwGsTXwLEOSNG0z7PDBxMWOCEARHTYikSEnwUQ3qO3Z82wl/pwsOf
a2lnMwNL/ztPIVOvtF0Qi7iBeE1v/H+7uxJYakfHUa1zgR0Yn9xh4ItXDY0RRPxD
RAjo4GyFBZcHCnxBqH2G6US70ClCWtJ7RGdisKhOn8eAa9/A+JvYqgsaAlwL6068
TM0Ky8c9XOLtWZ7yBU5Dlb6/733UZ9DuRn06iBKRzRT23wmP1J2m78RKv/7gJJD3
AO0dnYZzPwKWzoU0IxR/wPqrnzcijXqCLJ9YE1Ueoq7MF4PX2nk3bQg2601kqoa6
lYPLDAVYaT5fWWgoHjyFyTRM+7RGReLJZhBhD3SyuRGnEOG1mMbt2qqVPb+aHhLi
zJ5Ma8H/MwsUXXRVcZKqH3hR9WHmafaeQYIcoB9BTqmPYbYHlE6lGb5OvlfdK0OG
wiY9XREIStc4FU4KPBh9HTtOxinL2z2ztr21X2HIp8LEn7RxyxDj6+HKSXTxvAuI
APpRAFgWckZsOB5Rfk21
=bfeR
-----END PGP SIGNATURE-----

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to