How to fix the ADF Security error “JpsAnonymousRoleImpl” in Jdev 11.1.1.6.0

I have created a sample ADF application in Jdev 11.1.1.6.0 and when executed in “Integrated Weblogic server” within Jdev, it did not display any error message in the console and the application web page is loaded in the default browser successfully.
Now I added the ADF Security for the Application. To do this, From the Menu options select the Application –> select Secure->Configure ADF Security
ADF Authentication and Authorization –> Form Based Authentication (Generate the default login and error pages. Should be something like “/login.html“) -> No Automatic Grants -> Finish.
Now when I executed my Application in Jdev, I was getting the “<CodebasePolicyHandler> <migrateDeploymentPolicies> Migration of codebase policy failed. Reason: {0}. oracle.security.jps.JpsException: java.lang.IllegalArgumentException: oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl”   error before my web page opens up in the browser.
Even after you delete the ADF security this error still occurs.
So Now lets see how to fix this error in the below steps.
1) Now open your newly JDev created jazn-data.xml file. It’s located in the Application Resources panel (usually located by your Data Controls and Projects expandable panels).
2) On the left, Select the Resource Grants –> Resource Type (Web Page dropdown) –> error page should have a key symbol by it.
3) Delete the anonymous role in the “Granted To” column. Now click the green button to add an Application Role.  You will find TWO “anonymous role” options, which is causing this error. So we have to delete some XML code in jazn-data.xml file.
4) To edit the jazn-data.xml file, Click the Source tab on the bottom of the page to open up the XML View. You’ll see the following piece of code.
<?xml version = ‘1.0’ encoding = ‘UTF-8′ standalone = ‘yes’?>
<jazn-data xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
           xsi:noNamespaceSchemaLocation=”http://xmlns.oracle.com/oracleas/schema/jazn-data-11_0.xsd”&gt;
  <jazn-realm default=”jazn.com”>
    <realm>
      <name>jazn.com</name>
    </realm>
  </jazn-realm>
  <policy-store>
    <applications>
      <application>
        <name>MyPortal</name>
        <app-roles>
<app-role>
            <name>anonymous-role</name>
            <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class>
            <display-name>anonymous-role</display-name>
          </app-role>
</app-roles>
        <jazn-policy>
          <grant>
            <grantee>
              <principals>
5) The <app-role>  </app-role> code in red font need to be either DELETED orCOMMENTED. Then SAVE the jazn-data.xml file.
6) Go back to the Resource Grants tab -> Resource Type (Web Page) and delete any “Granted To” authorizations that may assigned to error and login pages.
7) Assigned a “Granted To” application role of “anonymous-role” to the error and login pages. Now here you will find only one “anonymous-role” option available to Grant to the Pages.
Now I executed the ADF application and I did not see the error in the “Integrated Weblogic Server” console in Jdev before my web page opens up in the browser.

Comments

Popular posts from this blog

React JS

WaterMark behavior in ADF

WebLogic Application Deployment & Shared Library