Prabhu, You need to extend the UsernamePasswordCredentials class i.e. (public class MyCredentials extends UsernamePasswordCredentials) and add a method to set the request object.
Then create a CredentialsBinder class which will call the setRequest method. You'll then just merely need to change the configuration of the cas-servlet.xml so that the authenticationViaForm action uses your Credentials and CredentialsBinder class. The request object will then be available for you. -Scott Prabhu wrote: > Hi Andrew, > > Thanks for the reply. I am basically trying to fix one of the bug that > I raised in CAS. http://www.ja-sig.org/issues/browse/CAS-357 > > The bug is basically about having ip based authentication. Scott had > closed the bug with the following comments. > > """ > the CAS infrastructure already supports this extension. > > Merely define a Credentials class that extends > UsernamePasswordCredentials that has a Request object and use a Custom > CredentialsBinder to place the Request object in the new Credentials > object. The Request object is then available to the > AuthenticationHandler. > """ > > I am having some trouble in making this customisation. So I started > customising few classes in the core package itself. Can you let me > know, if there is a better way to do this customisation, without > patching any core classes? > > Thanks, > Prabhu > > On 7/5/06, *Andrew Petro* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Prabhu, > > Instead of modifying a CAS core class, I'd strongly suggest > instead writing > a new class, with your own package name and classname, and > configuring CAS > to use that instead. Then you can take advantage of the deployer > Ant-driven > build process. > > The idea is that the CAS project using Maven produces APIs and binary > deliverables that constitutes the core of CAS, and you as a > deployer produce > configuration, extensions, and plugins that constitute your local > usage of > CAS. The Ant-driven deployer build process will build your > classes against > CAS core and build the resulting .war. > > Of course, this is an opensource product, and you can modify it > and rebuild, > but if you can avoid doing that, things are easier. If there's an > extension > point that you need that the core framework doesn't provide, > please let the > CAS developers know what it is -- maybe the extension point should > be added. > > Andrew > > ________________________________________ > From: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > [mailto:[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>] On > Behalf Of Prabhu > Sent: Tuesday, July 04, 2006 1:23 AM > To: [email protected] <mailto:[email protected]> > Subject: How to compile CAS source > > Hi all, > > I downloaded CAS-server source sometime back. I have made a small > change to > one of the Credentials Sources and now want to make my own custom > build. I > downloaded maven and tried giving, "mvn install". But the build didn't > succeed giving some strange error. > > Can someone help me with the correct procedure. > > -- > Prabhu > Mobile: (91) 98414 05819 > > _______________________________________________ > Yale CAS mailing list > [email protected] <mailto:[email protected]> > http://tp.its.yale.edu/mailman/listinfo/cas > <http://tp.its.yale.edu/mailman/listinfo/cas> > > > ------------------------------------------------------------------------ > > _______________________________________________ > Yale CAS mailing list > [email protected] > http://tp.its.yale.edu/mailman/listinfo/cas > _______________________________________________ Yale CAS mailing list [email protected] http://tp.its.yale.edu/mailman/listinfo/cas
