Showing posts with label adf security. Show all posts
Showing posts with label adf security. Show all posts

Thursday, 11 August 2011

ADF Security : Logout action

ADF Security provides an Authentication Servlet with a logout method in order to invalidate the JAAS Session that was initialised on login. For completeness sake I've listed the java code you can use in your backing bean's action method in order to call this servlet method:
public String onLogout() {
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    ExternalContext eCtx = facesCtx.getExternalContext();
    String url = eCtx.getRequestContextPath() +
        "/adfAuthentication?logout=true&end_url=/faces/index.jspx";
    try {
        eCtx.redirect(url);
    } catch(IOException e) {
        e.printStackTrace();
    }
    facesCtx.responseComplete();   
    return null;
}

Friday, 29 July 2011

ADF Security : JDeveloper 11g Release 2 (11.1.2.0)

Although I know about the bug with the anonymous role in JDeveloper 11.1.1.5, I used the standard wizard approach in applying ADF Security to my application. However that did not work at all. 
After Weblogic started up and my page should load, Weblogic seemed to be caught in an endless loop?!?!?!?

These were my steps to get it working:

  1. I only configured one (1) realm called: 'myrealm' and also made it the default realm (in other words, I deleted the realm named 'jazn'). After I did this and tried to test it, I got the known error (InvocationTargetException) which occurs when JDeveloper tries to migrate the security policies when your realm contains the 'anonymous-role'
  2. After deleting the 'anonymous-role' from my realm (<app-roles>-section in jazn-data.xml) the security policies were migrated successfully on the next startup of Weblogic.
Hooohooo!! :-)