2 Replies Latest reply on Jan 12, 2010 10:09 AM by lesquivel

    HttpRequest in Custom Login Module

      Hi,

      I am using JAAS Custom LoginModule it is extended by AbstractServerLoginModule. I would like to use HttpRequest object inside my custom LoginModule. Could you please let me know how to get HttpRequest in my custom LoginModule. Is it possible to use HttpRequest in custom LoginModule.
      And also I have couple of questions.

      1. Is auto-login is possible using JAAS. If Yes, How to do auto-login in JAAS? [Auto-login : Without prompting dialog box/FORM jsp for user credentails. ]
      2. Is JAAS support Cookie authentication? - I have cookie in my browser which is created by 3-party application, using this cookie I would like to get authenticated using JAAS. If Yes, please let me know the process/steps to do.
      3. How to get HttpRequest object in my custom LoginModule?

      Thanks!

        • 1. Re: HttpRequest in Custom Login Module
          HttpServletRequest request =
                          (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
          • 2. Re: HttpRequest in Custom Login Module
            lesquivel

            Hi,

             

            in our custom login module we get is as such:

             

              private HttpServletRequest getHttpRequestInfo() {

                /** The JACC PolicyContext key for the current Subject */

                HttpServletRequest request = null;

                try {

                  request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");

                } catch (PolicyContextException e) {

                  logger.error("Exception in getHttpRequestInfo(): " + e);

                  e.printStackTrace();

                }

                return request;

              }