Re: getting parameters from j_security_check form

Christopher Schultz <chris-Nf+wZpSdgwfUvtVhod0YCwZWvwf/[email protected]> Thu, 11 Jun 2009 10:45:03 -0400
Newsgroups gmane.comp.java.securityfilter.user
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============4949018322482321639==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enigBCE15BA2597B6FF8E18A93D6"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigBCE15BA2597B6FF8E18A93D6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Chris

On 6/10/2009 5:29 PM, Christopher Maloof wrote:
> I'm working on an app that uses JNDI Realm authentication, and I'd like=
=20
> the user to be able to pass additional parameters through the login pag=
e=20
> (say, a third field besides username and password).
>=20
> I think it's not possible to do this through regular container-based=20
> authentication.

Correct. Container-managed auth implementations will hide the
authentication request from your webapp, and you can't get the data.

> Is it possible to access an extra parameter in the=20
> j_security_check form using SecurityFilter?

Yes.

> If so, how?

There are several ways:

1. Write your own filter that runs before or after sf and do whaetever
you want.

2. Implement your own Realm that implenents FlexibleSecurityRealm which
has full access to the request object. You can pull-out any information
you'd like.

I like #2 because it's much more likely to work properly (!) and you
probably want to implement your own Realm in this case, anyway.

I do this on my current project in order to log failed logins' source IP
address (available from the request object).

In order to use FlexibleSecurityRealm, I believe you need to get the
latest sf code from CVS and compile it yourself (it's no big deal, you
just have to have Apache ant and a JDK installed).

I hope that helps,
-chris


--------------enigBCE15BA2597B6FF8E18A93D6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoxGHEACgkQ9CaO5/Lv0PC9yQCeLJMaCTf/oVLpCbXsd2Xy7UIy
ZOYAoKJ9BxNDBXlT+YqGP0buAS5J5Zn7
=uSDo
-----END PGP SIGNATURE-----

--------------enigBCE15BA2597B6FF8E18A93D6--


--===============4949018322482321639==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
--===============4949018322482321639==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
securityfilter-user mailing list
securityfilter-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/securityfilter-user

--===============4949018322482321639==--