2 Replies Latest reply on Jul 16, 2019 8:52 PM by 3905084

    Getting NameError: grantAppRole when assiging role from WLSTInterpreter

    3905084

      Hi,

       

      I am using Weblogic 12.2.1.3 Server. When I am trying to assign role from Java code using WLSTInterpreter getting the NameError: grantAppRole.

      Though the same works fine from plain Java Class main method. Could not run it when deployed from an ADF Application to integrated Weblogic server or Standalone server.

       

      Below is the code I am using.. Please let me know if any one has faced similar issue.

       

      Error:

      Traceback (innermost last):

        File "<string>", line 1, in ?

      NameError: grantAppRole

       

       

      Code:

          static InteractiveInterpreter interpreter = new WLSTInterpreter();

       

              StringBuffer buffer = new StringBuffer();

              buffer.append("connect('weblogic','weblogic1','localhost:7101')");

              interpreter.exec(buffer.toString());

       

                  buf = new StringBuffer();

                  buf.append("grantAppRole(appStripe='AppName',appRoleName='RoleNameRemove',principalClass='weblogic.security.principal.WLSUserImpl',principalName='devAdmin1') \n");

                  buf.append("print 'Script ran successfully ...' \n");

                  interpreter.exec(buf.toString());