Topic
  • 4 replies
  • Latest Post - ‏2014-05-14T11:13:13Z by Mita201
MarioSergioSL
MarioSergioSL
2 Posts

Pinned topic Apiscripts in Jython -- ITIM or ISIM?

‏2013-11-07T13:48:28Z |

I´m trying to use the API for Tivoli Security Identity Manager (SIM). However, the example scripts all reference ITIM, including some of the API objects and functions. I noticed that some of the objects are named after SIM, so I cannot get some of the scripts to work.

Could someone shed a light on what should I do here?

=======

# apiscript/bin/apiscript.ksh -f sim/lab/create_service_and_reconciliation_loop.py
Using host properties: "sim/apiscript/etc/host/simp102.properties".
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
Welcome to IBM Tivoli Identity Manager API Scripting Tool (apiscript) version: 5.0.0.4
Setting system property: java.security.auth.login.config
Setting com.ibm.CORBA properties: loginSource, loginUserid, loginPassword
WASX7017E: Exception received while running file "sim/lab/create_service_and_reconciliation_loop.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 8, in ?
  File "sim/apiscript/Lib/apiscript/util/__init__.py", line 144, in get_default_platform_ctx_and_subject
  File "sim/apiscript/Lib/apiscript/util/__init__.py", line 126, in create_default_platform_ctx_and_subject
  File "sim/apiscript/Lib/apiscript/util/__init__.py", line 114, in create_login_ctx
javax.security.auth.login.LoginException: No LoginModules configured for ITIM
        at javax.security.auth.login.LoginContext.init(LoginContext.java:279)
        at javax.security.auth.login.LoginContext.<init>(LoginContext.java:426)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
        at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java)
        at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java)
        at org.python.core.PyJavaClass.__call__(PyJavaClass.java)
        at org.python.core.PyObject.__call__(PyObject.java)
        at apiscript.util$py.create_login_ctx$6(sim/apiscript/Lib/apiscript/util/__init__.py:114)
        at apiscript.util$py.call_function(sim/apiscript/Lib/apiscript/util/__init__.py)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at apiscript.util$py.create_default_platform_ctx_and_subject$7(sim/apiscript/Lib/apiscript/util/__init__.py:126)
        at apiscript.util$py.call_function(sim/apiscript/Lib/apiscript/util/__init__.py)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at apiscript.util$py.get_default_platform_ctx_and_subject$8(sim/apiscript/Lib/apiscript/util/__init__.py:144)
        at apiscript.util$py.call_function(sim/apiscript/Lib/apiscript/util/__init__.py)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at org.python.core.PyObject.invoke(PyObject.java)
        at org.python.pycode._pyx48.f$0(<string>:8)
        at org.python.pycode._pyx48.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyCode.call(PyCode.java)
        at org.python.core.Py.runCode(Py.java)
        at org.python.core.Py.exec(Py.java)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
        at com.ibm.bsf.engines.jython.JythonEngine$BSFPythonInterpreter.exec(Unknown Source)
        at com.ibm.bsf.engines.jython.JythonEngine.exec(Unknown Source)
        at com.ibm.bsf.BSFManager$6.run(Unknown Source)
        at java.security.AccessController.doPrivileged(AccessController.java:251)
        at com.ibm.bsf.BSFManager.exec(Unknown Source)
        at com.ibm.ws.scripting.AbstractShell.executeScript(AbstractShell.java:1196)
        at com.ibm.ws.scripting.AbstractShell.run(AbstractShell.java:2209)
        at com.ibm.ws.scripting.WasxShell.main(WasxShell.java:1010)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:213)
        at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)
        at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
        at org.eclipse.core.launcher.Main.run(Main.java:981)
        at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:341)
        at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:111)

javax.security.auth.login.LoginException: javax.security.auth.login.LoginException: No LoginModules configured for ITIM

=========

 

 

  • franzw
    franzw
    339 Posts

    Re: Apiscripts in Jython -- ITIM or ISIM?

    ‏2013-11-07T14:06:39Z  

    The login method between ITIM 5.x and ISIM 6 has changed - this means that the API scripting tool for ITIM 5.x will not work on ISIM 6.

    You can eventually check to see if the author has updated the package on ISML - else you are probably out of luck.

    Your alternatives are to use the simple APPS in the examples folder or creating you combination of Java/TDI/ISIM APPS API or ISIM WS.  As a warning - setting the ISIM APPS API up remotely is not for the faint hearted  and requires work the may look to black magic for outsiders :-)

    Regards

    Franz Wolfhagen

  • MarioSergioSL
    MarioSergioSL
    2 Posts

    Re: Apiscripts in Jython -- ITIM or ISIM?

    ‏2013-11-08T10:07:30Z  
    • franzw
    • ‏2013-11-07T14:06:39Z

    The login method between ITIM 5.x and ISIM 6 has changed - this means that the API scripting tool for ITIM 5.x will not work on ISIM 6.

    You can eventually check to see if the author has updated the package on ISML - else you are probably out of luck.

    Your alternatives are to use the simple APPS in the examples folder or creating you combination of Java/TDI/ISIM APPS API or ISIM WS.  As a warning - setting the ISIM APPS API up remotely is not for the faint hearted  and requires work the may look to black magic for outsiders :-)

    Regards

    Franz Wolfhagen

    thx Franz!

  • anderson@wire-tap.net
    1 Post

    Re: Apiscripts in Jython -- ITIM or ISIM?

    ‏2014-01-06T00:37:56Z  

    thx Franz!

    Mario,

    Try the following after fixing up the path name for the __init__.py file:

    (cat <<-END

    125d

    114c

      login_ctx = LoginContext("WSLogin", platform_callback_handler)

    .

    104c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimRealm,itimPassword)

    .

    102c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimRealm)

    .

    99c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimPassword)

    .

    97c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser)

    .

    95c

      if itimRealm is None:

    .

    88,89c

      if itimRealm is None:

        itimRealm = System.getProperty("enrole.appServer.realm")

    .

    75c

    def create_platform_callback_handler(itimRealm=None,itimUser=None,itimPassword=None):

    .

    41a

      environment.put(PlatformContext.PLATFORM_REALM, platformRealm)

    .

    37a

      if platformRealm is None:

        platformRealm = System.getProperty("enrole.appServer.realm")

    .

    18c

    def create_platform_ctx_environment(contextFactory=None,platformURL=None,platformRealm=None,platformPrincipal=None,platformCredentials=None):

    .

    11a

    from com.ibm.websphere.security.auth.callback import WSCallbackHandlerImpl

    .

    9c

    from javax.security.auth.callback import CallbackHandler

    .

    )| ed - /opt/IBM/isim/apiscript/Lib/apiscript/util/__init__.py

  • Mita201
    Mita201
    109 Posts

    Re: Apiscripts in Jython -- ITIM or ISIM?

    ‏2014-05-14T11:13:13Z  

    Mario,

    Try the following after fixing up the path name for the __init__.py file:

    (cat <<-END

    125d

    114c

      login_ctx = LoginContext("WSLogin", platform_callback_handler)

    .

    104c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimRealm,itimPassword)

    .

    102c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimRealm)

    .

    99c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser,itimPassword)

    .

    97c

          platform_callback_handler = WSCallbackHandlerImpl(itimUser)

    .

    95c

      if itimRealm is None:

    .

    88,89c

      if itimRealm is None:

        itimRealm = System.getProperty("enrole.appServer.realm")

    .

    75c

    def create_platform_callback_handler(itimRealm=None,itimUser=None,itimPassword=None):

    .

    41a

      environment.put(PlatformContext.PLATFORM_REALM, platformRealm)

    .

    37a

      if platformRealm is None:

        platformRealm = System.getProperty("enrole.appServer.realm")

    .

    18c

    def create_platform_ctx_environment(contextFactory=None,platformURL=None,platformRealm=None,platformPrincipal=None,platformCredentials=None):

    .

    11a

    from com.ibm.websphere.security.auth.callback import WSCallbackHandlerImpl

    .

    9c

    from javax.security.auth.callback import CallbackHandler

    .

    )| ed - /opt/IBM/isim/apiscript/Lib/apiscript/util/__init__.py

    It works for me, on windows, once I have modified the file as mr. Anderson have explained.

    Thanks for your effort. I am attaching modified file.

     

    m.

    Attachments