This discussion is archived
5 Replies Latest reply: Nov 14, 2012 2:01 AM by Mohammad Jabr RSS

ADF Login page problem

764189 Newbie
Currently Being Moderated
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
L-
  • 1. Re: ADF Login page problem
    Mohammad Jabr Guru
    Currently Being Moderated
    What is the browser you are using?
    Did you try to test it in different browser?
  • 2. Re: ADF Login page problem
    764189 Newbie
    Currently Being Moderated
    Hi,
    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?

    Thk
    L-
  • 3. Re: ADF Login page problem
    Mohammad Jabr Guru
    Currently Being Moderated
    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 Employee ACE
    Currently Being Moderated
    Hi,

    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.

    Frank
  • 5. Re: ADF Login page problem
    Mohammad Jabr Guru
    Currently Being Moderated
    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);
                //ServletAuthentication.generateNewSessionID(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) {
                e.printStackTrace();
            }
    
            return null;
        }
    Note:
    we are using JDeveloper 11.1.2.3.0.
    Bug ID: 14812359

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points