1 Reply Latest reply: Jun 20, 2011 7:34 AM by 772286 RSS

    ADF Security , Policies, task flows   problems.

    772286
      HI every one

      I have a problem with the application policies.

      I created a Loggin_page.jspx page , index_usuario.jspx page , and 2 BOunded task flow. In the index page I put 2 buttons linked to 2 bounded task flows. ( All this in a UNBounded task flow 'adfc-config', draggin and dropping the task flow on the "adfc-config" and configuring the button's actions respectly to launch the task flows )

      For the loggin Bean I'm using this code :

      public String logeear_action() // this is for the commandButton's property called : ACTION , in the Loggin_page's panelFormLayout
      {

      String un = _username;
      byte[] pw = _password.getBytes();
      FacesContext ctx = FacesContext.getCurrentInstance();
      HttpServletRequest request = ( HttpServletRequest )ctx.getExternalContext().getRequest();

      try {
      Subject subject = Authentication.login(new URLCallbackHandler(un, pw));
      weblogic.servlet.security.ServletAuthentication.runAs(subject, request);

      String loginUrl = "/adfAuthentication?success_url=/faces/Loggins_usuario/index_usuario.jspx";

      HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
      sendForward(request, response, loginUrl);
      } catch ( FailedLoginException fle) {

      FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Incorrect Username or Password", "An incorrect Username or Password was specified");

      ctx.addMessage(null, msg);

      } catch (LoginException le) {
      reportUnexpectedLoginError("LoginException", le);
      }

      return null;

      } // fin funcion

      private void sendForward(HttpServletRequest request, HttpServletResponse response, String forwardUrl) {

      FacesContext ctx = FacesContext.getCurrentInstance();
      RequestDispatcher dispatcher = request.getRequestDispatcher(forwardUrl);
      try {
      dispatcher.forward(request, response);
      } catch (ServletException se) {
      reportUnexpectedLoginError("ServletException", se);
      } catch (IOException ie) {
      reportUnexpectedLoginError("IOException", ie);
      }
      ctx.responseComplete();
      }

      private void reportUnexpectedLoginError(String errType, Exception e) {

      FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected error during login",
      "Unexpected error during login (" + errType + "), please consult logs for detail");
      FacesContext.getCurrentInstance().addMessage(null, msg);
      e.printStackTrace();

      } // fin funcion


      I added this Class to the "adfc-config's" bean tab. for to do the loggin action.

      I created one one user, one Enterprice Role and one Application Role
      -user = user_1;
      -Enterprice Role = group_1,
      -Application Role called = appRole_1

      user_1 is group_1's member and group_1 is appRole_1's member. I created policies for all that and I added the anonymous role .

      I gave permission of 'VIEW' on the bounded task flow to the "appRole_1" .

      When I run my application, I logged correctly, the loggin redirect me to the "index_usuario.jspx page" correctly, but when I clicked on any button to launch the Bounded task flow linked to them, this does not run. Do not show me NOTHING.

      Why is this ?? If I logged correctly. How I can fix that problem ??? I review the policies again and again , and nothing, I restart the webLogic and nothing .

      Can any one help me Please ??? I need it !!!! for my proyect.

      Thanks !!

      I forgot !!! I'm using :

      Oracle JDeveloper 11g Release 1 11.1.1.3.0
      Studio Edition Version 11.1.1.3.0
      Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
      Copyright © 1997, 2010 Oracle and/or its affiliates. All rights reserved.
      IDE Version: 11.1.1.3.37.56.60
      Product ID: oracle.jdeveloper
      Product Version: 11.1.1.3.37.56.60

      Version
      -------

      Component     Version
      =========     =======
      ADF Business Components     11.1.1.56.60
      Java(TM) Platform     1.6.0_18
      Oracle IDE     11.1.1.3.37.56.60
      Versioning Support     11.1.1.3.37.56.60

      Edited by: Marco on 13-jun-2011 20:58