Menu

Application access to realm

Help
Anonymous
2006-10-16
2013-04-15
  • Anonymous

    Anonymous - 2006-10-16

    Is there any clean way for application code to get a handle to the realm implementation that is being used by the filter/auhtenticator?
    I need to be able to do things from within the app to my realm, but because the instance is created by the SF digester, I can't get a reference to it.

    Any help appreciated,
    Eric

     
    • Lars G. Svensson

      I don't know if there are other solutions, but I had this problem too and solved it by rewriting parts of SecurityFilter (s. https://sourceforge.net/forum/message.php?msg_id=2542247\)
      My realm implementation is really only a thin wrapper around another object (sitting in the servlet context) which takes care of the user management, and through the extension of SecurityFilter I can access the servlet context when initializing the realm.

      Regards

      Lars

       
      • Anonymous

        Anonymous - 2006-10-17

        For now I've gone with a similar solution, although I used JNDI instead of servlet context. I include a boolean property on my realm, storeInJNDI. In the setter for that property, I grab a local JNDI context and bind the realm in it. Then my app code can look up the JNDI name to get the realm instance.
        It seems to work, but it is kind of kludgey - I still think an accessor to the realm should be exposed by the SF API somewhere.

         

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.