ADF throws PolicyStoreAccessPermission - OPSS api addPrincipalToAppRole

I am facing PolicyStoreAccessPermission exception when trying to call OPPS API - ApplicationPolicy.addPrincipalToAppRole() for a PoC using JDeveloper 11.1.1.7 and 11.1.1.6 both. I know this issue has been resolved in some other threads and solutions suggested but none of them seems to be working for me.
My code is very simple -
JpsContextFactory ctxf = JpsContextFactory.getContextFactory();
JpsContext ctx = ctxf.getContext();
storeService = ctx.getServiceInstance(IdentityStoreService.class);
ps = ctx.getServiceInstance(PolicyStore.class);
policy= policyStore.getApplicationPolicy(<applicationName>);
*// find the principal etc..*
policy.addPrincipalToAppRole(principal, somerole);
It works fine before I call addPrincipalToAppRole method. I added grants to "weblogic" and "codesource" in system-jazn-data.xml
<jazn-data>
<jazn-realm default="jazn.com">
<realm>
<name>jazn.com</name>
</realm>
</jazn-realm>
<policy-store>
<applications>
<application locale="en_US">
<jazn-policy>
<TRIED GRANTS HERE>
</jazn-policy>
</application>
</applications>
</policy-store>
<jazn-policy>
<TRIED GRANTS HERE>
</jazn-policy>
</jazn-data>
code source grant which added -
<grant>
<grantee>
<codesource>
<url>file:${domain.home}/../o.j2ee/drs/TablePaginationApp/-</url>
</codesource>
</grantee>
<permissions>
<permission>
          <class>oracle.security.jps.service.policystore.PolicyStoreAccessPermission</class>
          <name>context=APPLICATION,name=*</name>
          <actions>getApplicationPolicy,createApplicationPolicy,deleteApplicationPolicy,grant,revoke,createAppRole,addPrincipalToAppRole,removeAppRole,removePrincipalFromAppRole,alterAppRole</actions>
</permission>
<permission>
<class>oracle.security.jps.service.policystore.PolicyStoreAccessPermission</class>
<name>context=SYSTEM,name=*</name>
<actions>*</actions>
</permission>
<permission>
<class>java.security.SecurityPermission</class>
<name>setPolicy</name>
</permission>
<permission>
<class>oracle.security.jps.service.credstore.CredentialAccessPermission</class>
<name>context=SYSTEM,mapName=*,keyName=*</name>
<actions>read,write</actions>
</permission>
<permission>
          <class>oracle.security.jps.JpsPermission</class>
          <name>AppSecurityContext.setApplicationID.*</name>
          </permission>
          <permission>
          <class>oracle.security.jps.service.trust.TrustServiceAccessPermission</class>
          <name>appId=*</name>
          <actions>issue</actions>
</permission>
</permissions>
</grant>
<grant>
<grantee>
<codesource>
<url>file:${domain.home}/servers/${weblogic.Name}/tmp/_WL_user/TablePaginationApp_application1/-</url>
</codesource>
</grantee>
<permissions>
<permission>
<class>oracle.security.jps.service.policystore.PolicyStoreAccessPermission</class>
<name>context=APPLICATION,name=*</name>
<actions>getApplicationPolicy,createApplicationPolicy,deleteApplicationPolicy,grant,revoke,createAppRole,addPrincipalToAppRole,removeAppRole,removePrincipalFromAppRole,alterAppRole</actions>
</permission>
<permission>
<class>oracle.security.jps.service.policystore.PolicyStoreAccessPermission</class>
<name>context=SYSTEM,name=*</name>
<actions>getApplicationPolicy,createApplicationPolicy,deleteApplicationPolicy,grant,revoke,createAppRole,addPrincipalToAppRole,removeAppRole,removePrincipalFromAppRole,alterAppRole</actions>
</permission>
<permission>
<class>java.security.SecurityPermission</class>
<name>setPolicy</name>
</permission>
<permission>
<class>oracle.security.jps.service.credstore.CredentialAccessPermission</class>
<name>context=SYSTEM,mapName=*,keyName=*</name>
<actions>read,write</actions>
</permission>
<permission>
          <class>oracle.security.jps.JpsPermission</class>
          <name>AppSecurityContext.setApplicationID.*</name>
          </permission>
          <permission>
          <class>oracle.security.jps.service.trust.TrustServiceAccessPermission</class>
          <name>appId=*</name>
          <actions>issue</actions>
</permission>
</permissions>
</grant>
Weblogic grant I added
<grant>
<grantee>
<principals>
<principal>
<class>oracle.security.jps.internal.core.principals.JpsAuthenticatedRoleImpl</class>
<name>weblogic</name>
</principal>
</principals>
</grantee>
<permissions>
<permission>
<class>oracle.security.jps.service.policystore.PolicyStoreAccessPermission</class>
<name>context=APPLICATION,name=*</name>
<actions>getApplicationPolicy,createApplicationPolicy,deleteApplicationPolicy,grant,revoke,createAppRole,addPrincipalToAppRole,removeAppRole,removePrincipalFromAppRole,alterAppRole</actions>
</permission>
</permissions>
</grant>
But nothing worked for me, i always get this exception -
java.security.AccessControlException: access denied (oracle.security.jps.service.policystore.PolicyStoreAccessPermission Context:APPLICATION Context Name:TablePaginationApp_application1 Actions:getApplicationPolicy)
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
     at java.security.AccessController.checkPermission(AccessController.java:546)
     at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:463)
     at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:523)
     at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:549)
     at oracle.security.jps.internal.policystore.PolicyUtil.checkPolicyStorePermission(PolicyUtil.java:1292)
Am i missing anything. please suggest.
Thanks!

Hi,
if you don't get an answer here, try the WebLogic security forum: WebLogic Server - Security
Frank

Similar Messages

  • OPSS API licensing question

    Hi product managers,
    Is there a licensing restriction on use of OPSS API's with ADF essentials ? Will this API be included in the future ADF essentials build ? Will there be a separate licensing cost for this API in this case one might use the Apache LDAP API's.
    I have seen the OPSS FAQ whitepaper but it said that post 11gr1 release they might offer it separately but the document is really old.
    Regards,
    Ramandeep Nanda

    Hi Ramandeep,
    Licensing questions are best answered directly by the Oracle Sales team - the answer could depend on the products that your company already have licensed, and how they are bundled etc.
    Regards,
    Colin

  • How to access an External LDAP on a weblogic server using OPSS APIs.

    Hi,
    Can anyone let me know how I can access an External LDAP configured on a weblogic server using OPSS APIs( or alternative APIs).
    I'm currently using the below snippet and I'm getting only the Users and groups from the DefaultAutheticator on the weblogic server and not the external LDAP Server.
    I've verified the providers, users and groups on the weblogic server console and can see that external LDAP server content is being picked, but my below code does not query them.
    import oracle.security.idm.IMException;
    import oracle.security.idm.IdentityStore;
    import oracle.security.idm.Role;
    import oracle.security.jps.JpsContext;
    import oracle.security.jps.JpsContextFactory;
    import oracle.security.jps.JpsException;
    import oracle.security.jps.service.idstore.IdentityStoreService;
    List<Role> rowData = null;
    JpsContextFactory ctxf = JpsContextFactory.getContextFactory();
    JpsContext ctx = ctxf.getContext();
    IdentityStoreService storeService = ctx.getServiceInstance(IdentityStoreService.class);
    IdentityStore idStore = storeService.getIdmStore();
    rowData = this.getRoles(idStore, "*");
    Any help or pointers are highly appreciated.
    Thanks,
    Bhasker

    Can anyone please provide any suggestions. I trying to google around but still not able to find any solution.
    Thanks,
    Bhasker

  • Exposing OPSS Api's as Webservice

    Hi Folks,
    In our application, we require to manage Portal Security via different application . I understand that OWC outsources its security needs to OPSS, thus my question is that can we create webservices on top of OPSS api's and manage portal security that way? Is it supported by Oracle ?
    Thanks
    Edited by: Chandan Thour on Jul 17, 2012 7:27 AM

    some samples at below link
    http://docs.oracle.com/cd/E14571_01/doc.1111/e14309/spmlapi.htm

  • Validate from Java Script Not accept html:form by ADF throw JSP

    I am using JDeveloper10g 10.1.2 by ADF throw JSP Pages
    the problem is :
    When i using JavaScript to check the validate of a Text Field by a message it is not accept the JavaScript Message because the View that i drag and drop it come with <html:form> not without html like <form> .
    Is there any body try to use JavaScript with any Application throw ADF Technology by JSP Pages ?
    plz help me ?

    I am using JDeveloper10g 10.1.2 by ADF throw JSP Pages
    the problem is :
    When i using JavaScript to check the validate of a Text Field by a message it is not accept the JavaScript Message because the View that i drag and drop it come with <html:form> not without html like <form> .
    Is there any body try to use JavaScript with any Application throw ADF Technology by JSP Pages ?
    plz help me ?

  • Oracle ADF Model and BC4J api reference in JDev 10.1.3.03

    Hi
    Where I can find Oracle ADF Model and Business Components API Reference in JDev 10.1.3.03? Maybe it's not ready yet?

    I don't know how up-to-date they are, but the javadoc files are all archived into jar files in the JDeveloper installation at: <jdev-install-dir>\jdev\doc\ohj. Most of the business component interfaces and classes are covered in the bc4jjavadoc.jar. You can either open the index.html file of the jar in JDeveloper and move through the links in the preview pane, or use the jar utility (or other unzipping util) to extract the jar file into your directory structure and then access the html files directly.
    Johnny Lee

  • OID using the OPSS API

    hi am using the below sample to create my OPSS,AM in jdeveloper 11.1.1.6.0,am having error in this class, the error is Error(50,16): cannot find variable IdentityStoreConfigurator and also Error(54,16): cannot find variable IdentityStoreConfigurator
    this are the method below,where is IdentityStoreConfigurator. define
    public static IdentityStore getStoreInstance() {
    return IdentityStoreConfigurator.initializeDefaultStore();
    public static IdentityStoreFactory getIdentityStoreFactory() {
    return IdentityStoreConfigurator.idStoreFactory;
    the sample is
    http://ramannanda.blogspot.com/2011/09/opss-adf-security-utility.html
    Edited by: ADF007 on 2012/09/12 11:30 AM

    yes my mistake so where must i enter this details
    ldap.url=ldap://your_ldap_server_ip:port
    user.create.bases=cn=Users,dc=oracle,dc=com
    username.attr=uid
    oidusername=userName
    #not safe
    oiduserpassword=userpass
    user.search.bases=cn=Users,dc=oracle,dc=com
    group.search.bases=cn=Groups,dc=oracle,dc=com
    oidsubscribername=dc=oracle,dc=com
    or
    Hostname:
    IP:
    OID Port:
    Base DN:
    User DN:
    Group DN:
    Admin User:
    Password:
    Edited by: ADF007 on 2012/09/12 2:36 PM

  • ADF BC: integrating REST API

    Using JDev 11g PS4
    The model of my application has a mix of different sources. Some entities are stored in my database.
    Other entities are coming from a call to an external REST API.
    I am wondering what the best solution is to integrate those REST API objects into my model project because I don't want to expose them as rest api to my view. In my view project, I want to hide the complexity of those API's by exposing data controls.
    Now, what is the best way?
    1) Creating POJO's and creating data controls out of them. These pojo's will have a signature like this:
    public class Foo {
       public List<FooObject> getFoos();
       public void addFoo(FooObject foo);
       public void removeFoo(FooObject foo);
    }This will be exposed to my view so I can easily use it in my view project.
    2) Create view objects to map the entities from my rest API and implement the REST API calls in the custom implementation of the view objects.
    3) ...
    Any other suggestion is more then welcom.

    Hi,
    if the rest of your model is ADF BC then it would feel natural to use prgrammatic view objects to access the REST service. However, if the data is unrelated then using a a POJO DC also appears to be a solution. For simple REST requests that return XML formatted data, you could use the URL Data Control which in 11g R1 allows for read access and in 11.1.2 the full REST CRUD cycle
    Frank

  • OPSS API for page ACL

    Hi,
    We just have migrated from the default security system, based on system-jazn-data.xml file, to the OPSS DB-based one.
    All migration operations have been done successfully.
    We have a custom application that allows administrators to extract a sitemap with pages name, location and ACLs (Group name, permissions)
    Unfortunately, we used to read this system-jazn-data file to know the groups and permissions on the pages.
    Now OPSS is here, I expect it to give my application the information it needs, as by the way the jazn file will not be up-to-date any longer.
    Where can I find help or documentation about theses API ? What do I have to do first to be able to interact with theses API (update xml files) ?
    Any help is welcome
    Thanks !

    Did you make sure that the jpsconfig-jse.xml file is located where you indicated it should be? You could also remove the java policy file or update it to give it all permissions. As an alternative, you could also try using the mkstore utility instead (comes with oracle database)

  • Invoking ADF Actions from JS API

    Is there a way to invoke an action from a javascript function? Something that would perhaps mimic what this commandLink does:
    <af:commandLink text="Lights, Camera, Action!"
    id="chuckNorris" action="flyingKick"/>
    What I am looking for is the ability to invoke the action "flyingKick" from a javascript function.

    Thanks, I actually already saw this. What I need though is something that doesn't a serverListener though - a programmatic version of a commandLink with an action if you will.

  • [ADF] migration to ADF, pl/sql based DB api

    We are planning to move one of our project to ADF (we using flex for now), we have all our DB working through the proc/functions API.
    Its about 50+ entities, lots of rename/update/create api already exists and working well.
    There seems a bit tricky to make ADF BC work through API, as I have found mere examples it looks like it more like exception from the rule, and every Entity and View BC is has to be rewritten by hand.
    There are two frameworks around - [Avroms’s Package based API|http://www.avromroyfaderman.com/framework-for-database-api-based-adf-bc/framework-for-package-api-based-adf-business-components/] that is 3 years old it works for our testing, but I encounter strange behavior when using BLOB fields. As Avrom abandoned it and here is a not right place to ask questions about his framework – I’m really stuck with it 
    Second framework is a evolution of the first one, Framework for Database API-Based ADF BC, and was hosted on oracle’s samplecode [is not avaible for now|https://database-api-based-adf-bc.samplecode.oracle.com/] , and there no way to get it.
    What will be best practice to solve my problem:
    1) Some simple way to build ADF BC on API, that is not obvious
    2) Someone who can help with old framework to get it work in proper way
    3) Try to convince PM to change the way new project work in ADF-native table/view way (it almost impossible, but who knows?)
    4) ??? some suggestions
    Thanks in advance

    Yes, it is, but when I trying to use that framework and encountered some strange behavior when I have Blob columns in viewObject:
    It looks like resultSet is missing first two rows.
    With empty resultSet or when number of rows is below 2 I have an error:
    (oracle.adf.model.connection.ConnectionException) JBO-29000: Unexpected exception caught: java.sql.SQLRecoverableException, msg=Closed Resultset: next
    In case when number of rows is more then two – there is no error, but results is shown from third row.
    Error can be reproduced in [Demo app|http://www.avromroyfaderman.com/wp-content/uploads/2009/05/packageapidemo.zip] :
    1) Add blob field to Employees table
    2) Modify GET_EMPS function to return new blob field
    3) adding blob field to Employees entity and EmloyeesView
    Thats make me stuck with it, as I have some blob fields in fundamental entities, so I can't proceed.
    Avrom’s blog looks abandoned, and my comment there is still waiting for pre-moderation for a week+ and no responce from author through contact form.
    I asked for newer framework version in the thread you pointing, but my post was deleted, assuming that all question on getting newer framework version must be pointed to Avrom or waiting for Frank to get his hands on project to make it EMG again.

  • ADF Controller State API

    Hello
    Is there any way to get the Controller state for the current page using Java Code.
    I am using document.location.search in java script, wonder if I can access the same using Some adf API.
    http://xxxx/xxxxxt/faces/login.jspx?*adf.ctrl-state=937739223*
    Thanks.

    My actual requirement to get the Controller state.
    I have page A which is a bounded task flow.When page A is closed i call a javascript to return the TaskFlow and pass document.location.search which will pass the controller state.
    But the problem comes when i open page B (another bounded Task Flow) from Page A and do return Task FLow from page B.
    It navigates back to Page A but then replaces the URL with new adf Controller State. When i actually execute Javascript to execute return Task FLow it gets appended with new Controller state.
    So i need a way to get the ADF Controller state through API instead of URL.

  • ADF CoreTree API is missing the ability to expand collapse from Java code?

    ADF-faces-10_1_3_0_4 CoreTree API:
    How do I expand and collapse a tree from Java code?
    Thanks,
    --Todd                                                                                                                                                                                                                                   

    You can use the search on the read only (normal mode) of the PL/SQL Editor. Either through menu or using ctrl F.
    The other is still an enhancement and is being tracked.
    Sue.

  • ADF datacontrol

    Hi, in oracle BPM there is a mapping of user with the roles.I have search the BPM database tables in dev_soainfra schema but no tables consists of mapping of these tables.I have a urgent requirement of it so that i can use it on adf form.
    Can anyone plz tell me where to get it.
    =>I got the Organization.XML file in BPM which consists of the mapping of these two.But i am not able to create datacontrol from xml file so that it can be used on adf form.Anyone plz help me out.
    Thanks

    Hi,
    you should ask this question on the SOA forum - SOA Suite for if there is a Java API to this. If there is then you can create a Data Control from the POJO bean. If the role is a logical role then this is mapped to a user role defined in the underlying IDM system, which is LDAP, RDBMS, etc. based on your server configuration. If you used the integrated LDAP in WLS then user roles are accessible through OPSS APIs. However, if you wanted to access the logical names used in BPM then for your you will need to ask the SOA group for APIs
    Frank

  • ADF Security Customization

    Hi All,
    I have unique requirement of creation of users, roles and policies.
    In my project i need to create users and roles dynamically other than from EM console or Jdeveloper i.e from front end. The data will flow through a BPEL process and the users, roles and policies have to be created.
    How to create these users in "system-jazn.xml" dynamically?
    Weblogic - 11g (11.1.1)
    Please let me know in case of any additional information required..
    Reagrds
    Surya

    Hi,
    its not an ADF Security question but OPSS (Oracle Platform Security Services), which is the owner of that file. However, this blog entry shows you how to use the OPSS API to access the Role Manager and User Manager in OPSS to do what you want
    http://fusionsecurity.blogspot.com/2009/07/opss-sample-application.html
    Frank

Maybe you are looking for