5 Replies Latest reply on Nov 14, 2012 10:01 AM by Mohammad Jabr

    ADF Login page problem

      Hi all,
      I developed an ADF application with login page based on OPSS, I'm facing with strange behaviour in the login page, I type user and pwd and click on login button but instead of redirect in the next page, the login page is refreshed and I have to type again my credentials. This happen two, three times (is random) then I'm able to have access.
      What can be the problem?

      Thk in advance
        • 1. Re: ADF Login page problem
          Mohammad Jabr
          What is the browser you are using?
          Did you try to test it in different browser?
          • 2. Re: ADF Login page problem
            no I didn't, I do just now and realize that with chrome the problem disappeared, before I tested only with IE.
            So it means that the problem is browser, how I can fix also for IE?

            • 3. Re: ADF Login page problem
              Mohammad Jabr
              We are using ADF security and we Faced similar problem three weeks ago. This problem occurred only in IE.
              After we contacted oracle support, they confirmed that this is a bug.
              • 4. Re: ADF Login page problem
                Frank Nimphius-Oracle

                I assume you use programmatic authentication as this doesn't occur for the login form generated by ADF Security (html) or basic authentication. If I am correct then change the code to redirect the request after authentication to the start page (instead of the forward explaned in the documentation). In addition ensure your form programmatic form based autentication page is not configured in web.xml as a default form based authentication page.

                • 5. Re: ADF Login page problem
                  Mohammad Jabr
                  Thank you Frank for your response.
                  Yes we are using programmatic authentication and custom login form. It works fine in IE7 and Firefox but IE8 and IE9 it is not working properly.

                  I tried your suggestion, but unfortunately, the problem is still exist.

                  here is our login method as your suggestion.
                      public String doLogin() {
                          String un = _username;
                          byte pw[] = _password.getBytes();
                          FacesContext ctx = FacesContext.getCurrentInstance();
                          HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
                          Subject mySubject;
                          try {
                              mySubject = Authentication.login(new URLCallbackHandler(un, pw));
                              ServletAuthentication.runAs(mySubject, request);
                              String loginUrl = "/adfAuthentication?success_url=/faces/protectedPage.jsf";
                              HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
                               //old code
                              //            RequestDispatcher dispatcher = request.getRequestDispatcher(loginUrl);
                             //            dispatcher.forward(request, response);
                              response.sendRedirect(request.getContextPath() + loginUrl);
                          } catch (FailedLoginException e) {
                              FacesMessage errorMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid Login", "Invalid Login");
                              ctx.addMessage(null, errorMsg);
                          } catch (Exception e) {
                          return null;
                  we are using JDeveloper
                  Bug ID: 14812359