Menu

ipaddress

John Ike
2008-03-02
2013-04-15
  • John Ike

    John Ike - 2008-03-02

    As part of authenticate(), I had long ago added some additional functionality that allowed me to add information into the my own Principle.  Right now I am trying to access a person's ipaddress as part of that authenticate so that I can add it to the database when they login.  Only problem is that the HttpRequest is not available to the authenticate().

    I recognize I can alter the library code, but I was hoping not to have to do so.  Any ideas on how to do this?

     
    • Koen Maes

      Koen Maes - 2008-03-02

      You could setup a filter that stores all required info into a static ThreadLocal.
      Next you can access this info anytime.

      Koen

       
    • Christopher Schultz

      If you use FlexibleRealmInterface for your Realm, you will have access to the entire HttpServletRequest. This requires you to get the SF source from CVS and build it yourself (which isn't a big deal, really).

      Since authenticate() returns a Principal, you can add anything you want to it.

      Hope that helps,
      -chris

       
    • John Ike

      John Ike - 2008-03-03

      Thanks Both.

      I ended up using Chris' solution.  I think it was an excellent way of handling trying to work with the request and it seems to work with some initial tests.  It would really be great if we had minor 2.1 release for that and the other changes I noticed in the release notes.  It would also be great to have the result placed in a maven library for auto-download.

      Thanks,

      John

       
      • Christopher Schultz

        There's actually a loose plan for a 2.1 release that will (of course) include everything so far, plus one more feature or two.

        After that, I think its time for a new major version with a (nearly) complete re-write of the architecture. It's currently pretty monolithic, and therefore difficult to add features or independently test certain components.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.