By: Wilbur Pereira user 21 Apr 2017 at 6:19 a.m. CDT

14 Responses
Wilbur Pereira gravatar
We are trying to implement a custom script to perform authentication. We have been trying but keep getting a python exception. What do you think is wrong with the script and is there a way to use custom scripts and get the exact cause of the error. Below is the code ``` import java import urllib2 import urllib from org.jboss.seam.security import Identity from org.xdi.model.custom.script.type.auth import PersonAuthenticationType from org.xdi.oxauth.service import UserService from org.xdi.util import StringHelper class PersonAuthentication(PersonAuthenticationType): def __init__(self, currentTimeMillis): self.currentTimeMillis = currentTimeMillis def init(self, configurationAttributes): print ("loginservice. Initialization") print ("loginservice. Initialized successfully") return True def destroy(self, configurationAttributes): print ("loginservice. Destroy") print ("loginservice. Destroyed successfully") return True def getApiVersion(self): return 1 def isValidAuthenticationMethod(self, usageType, configurationAttributes): return True def getAlternativeAuthenticationMethod(self, usageType, configurationAttributes): return None def authenticate(self, configurationAttributes, requestParameters, step): url = "http://abc.domain.com/Service/services/ServiceImpl?wsdl" body = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://abc.domain.com" xmlns:xsd="http://beans.itzcash.com/xsd"> <soapenv:Header/> <soapenv:Body> <ser:validate> <!--Optional:--> <ser:param> <!--Optional:--> <xsd:modeType>WEB</xsd:modeType> <!--Optional:--> <xsd:mystring>skdjhgskjdhgsd9878978</xsd:mystring> <!--Optional:--> <xsd:name>John</xsd:name> </ser:param> </ser:validate> </soapenv:Body> </soapenv:Envelope>""" data = body # headers = {'Content-Type': 'application/soap+xml; charset=utf-8'} headers = {'content-type': 'text/xml'} req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) the_page = response.read() print(the_page) def prepareForStep(self, configurationAttributes, requestParameters, step): if (step == 1): print ("loginservice. Prepare for Step 1") return True def getExtraParametersForStep(self, configurationAttributes, step): return None def getCountAuthenticationSteps(self, configurationAttributes): return 1 def getPageForStep(self, configurationAttributes, step): return "" def logout(self, configurationAttributes, requestParameters): return True ``` Exception in the oxtrust_log ``` 2017-04-21 16:42:49,746 ERROR [pool-2-thread-7] [org.xdi.service.custom.script.CustomScriptManager] (CustomScriptManager.java:381) - null java.lang.NullPointerException: null at org.xdi.service.custom.script.CustomScriptManager.executeCustomScriptDestroy(CustomScriptManager.java:379) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.destroyCustomScript(CustomScriptManager.java:292) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadCustomScriptConfigurations(CustomScriptManager.java:205) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadImpl(CustomScriptManager.java:143) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reload(CustomScriptManager.java:131) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadTimerEvent(CustomScriptManager.java:107) [oxService-3.0.1.jar:?] at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.xdi.service.custom.script.CustomScriptManager_$$_javassist_seam_26.reloadTimerEvent(CustomScriptManager_$$_javassist_seam_26.java) [oxService-3.0.1.jar:?] at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.Component.callComponentMethod(Component.java:2313) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.Events.raiseEvent(Events.java:85) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousEvent$1.process(AsynchronousEvent.java:33) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousEvent.execute(AsynchronousEvent.java:27) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.ThreadPoolDispatcher$RunnableAsynchronous.run(ThreadPoolDispatcher.java:142) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_112] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112] 2017-04-21 16:42:49,750 ERROR [pool-2-thread-7] [org.xdi.service.custom.script.CustomScriptManager] (CustomScriptManager.java:294) - Failed to destroy custom script '@!4205.D660.D484.EAA8!0001!98A5.9BA4!8AAC.EBDB' correctly 2017-04-21 16:42:49,768 ERROR [pool-2-thread-7] [org.xdi.service.PythonService] (PythonService.java:153) - Failed to load python file 2017-04-21 16:42:49,769 ERROR [pool-2-thread-7] [org.xdi.service.custom.script.CustomScriptManager] (CustomScriptManager.java:324) - Failed to prepare external type '@!4205.D660.D484.EAA8!0001!98A5.9BA4!8AAC.EBDB' org.xdi.exception.PythonException: Failed to load python file 'java.io.ByteArrayInputStream@6ca16232' at org.xdi.service.PythonService.loadPythonScript(PythonService.java:154) ~[oxService-3.0.1.jar:?] at sun.reflect.GeneratedMethodAccessor246.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.xdi.service.PythonService_$$_javassist_seam_8.loadPythonScript(PythonService_$$_javassist_seam_8.java) ~[oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.createExternalTypeFromStringWithPythonException(CustomScriptManager.java:348) ~[oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.createExternalType(CustomScriptManager.java:322) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadCustomScriptConfigurations(CustomScriptManager.java:238) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadImpl(CustomScriptManager.java:143) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reload(CustomScriptManager.java:131) [oxService-3.0.1.jar:?] at org.xdi.service.custom.script.CustomScriptManager.reloadTimerEvent(CustomScriptManager.java:107) [oxService-3.0.1.jar:?] at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.xdi.service.custom.script.CustomScriptManager_$$_javassist_seam_26.reloadTimerEvent(CustomScriptManager_$$_javassist_seam_26.java) [oxService-3.0.1.jar:?] at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.Component.callComponentMethod(Component.java:2313) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.Events.raiseEvent(Events.java:85) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousEvent$1.process(AsynchronousEvent.java:33) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.AsynchronousEvent.execute(AsynchronousEvent.java:27) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.async.ThreadPoolDispatcher$RunnableAsynchronous.run(ThreadPoolDispatcher.java:142) [jboss-seam-2.3.1.Final.jar:2.3.1.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_112] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112] Caused by: org.python.core.PyException at org.python.core.Py.NameError(Py.java:284) ~[jython-2.7.0.jar:?] at org.python.core.PyFrame.getname(PyFrame.java:257) ~[jython-2.7.0.jar:?] at org.python.pycode._pyx38.f$0(<iostream>:74) ~[?:?] at org.python.pycode._pyx38.call_function(<iostream>) ~[?:?] at org.python.core.PyTableCode.call(PyTableCode.java:167) ~[jython-2.7.0.jar:?] at org.python.core.PyCode.call(PyCode.java:18) ~[jython-2.7.0.jar:?] at org.python.core.Py.runCode(Py.java:1386) ~[jython-2.7.0.jar:?] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:296) ~[jython-2.7.0.jar:?] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:291) ~[jython-2.7.0.jar:?] at org.xdi.service.PythonService.loadPythonScript(PythonService.java:151) ~[oxService-3.0.1.jar:?] ... 56 more 2017-04-21 16:42:49,777 INFO [pool-2-thread-7] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Permission dynamic scope. Destroy 2017-04-21 16:42:49,778 INFO [pool-2-thread-7] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Permission dynamic scope. Destroyed successfully 2017-04-21 16:42:49,792 INFO [pool-2-thread-7] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Permission dynamic scope. Initialization 2017-04-21 16:42:49,793 INFO [pool-2-thread-7] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Permission dynamic scope. Initialized successfully ```

By Aliaksandr Samuseu staff 21 Apr 2017 at 8:50 a.m. CDT

Aliaksandr Samuseu gravatar
Hi, Wilbur. Auth script-related exceptions should go to `oxauth_script.log`. Did you check it too? Please provide related contents from it here.

By Wilbur Pereira user 21 Apr 2017 at 9:12 a.m. CDT

Wilbur Pereira gravatar
Apologies, the log excerpt is from oxauth_script.log. The same is not really helpful. We modified the script and it is loading now but we are unable to post a SOAP request now and the execution stops at The actual post does not happen starting from the data variable ``` data = body # headers = {'Content-Type': 'application/soap+xml; charset=utf-8'} headers = {'content-type': 'text/xml'} req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) the_page = response.read() print(the_page) ```

By Aliaksandr Samuseu staff 21 Apr 2017 at 9:42 a.m. CDT

Aliaksandr Samuseu gravatar
> We modified the script and it is loading now Could you explain briefly what was the original issue? Regarding the latter, I'm not sure it's Gluu-related issue.. May be you should try to do some debugging now? Change script's storage method to "File" for convenience and utilize Python's exceptions catching features to make sure all of them are registered. Something like this: ``` ... import sys ... try: ... some block of code ... except Exception, ex: print "Debugging point #1" print "Unexpected error:", ex except: print "Debugging point #2" print "Unexpected error:", sys.exc_info()[0] ``` You could also take this code snippet out of Gluu's script and run it in some simple standalone script to make sure it works at all.

By Wilbur Pereira user 21 Apr 2017 at 9:47 a.m. CDT

Wilbur Pereira gravatar
The original issue was that we were not able to save the custom script with the SOAP request/post. Now after a lot of modifications and fixing indentations in the script, we have managed to get it to work but not beyond the lines of code pasted. Is there a snippet that we can use as a sample/template to make SOAP requests ?

By Aliaksandr Samuseu staff 21 Apr 2017 at 9:54 a.m. CDT

Aliaksandr Samuseu gravatar
>Is there a snippet that we can use as a sample/template to make SOAP requests ? The idea is to simply create a very basic python script and put this code sending SOAP request in it. Then just make sure it really sends something (a lot of tools can show it: web server's logs, Wireshark etc)

By Wilbur Pereira user 21 Apr 2017 at 10:11 a.m. CDT

Wilbur Pereira gravatar
This part of the code has been tested and working in python but fails to work when added to gluu as a custom script ``` import urllib2 import urllib url = "http://abc.domain.com/Service/services/ServiceImpl?wsdl" body = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://abc.domain.com" xmlns:xsd="http://beans.itzcash.com/xsd"> <soapenv:Header/> <soapenv:Body> <ser:validate> <!--Optional:--> <ser:param> <!--Optional:--> <xsd:modeType>WEB</xsd:modeType> <!--Optional:--> <xsd:mystring>skdjhgskjdhgsd9878978</xsd:mystring> <!--Optional:--> <xsd:name>John</xsd:name> </ser:param> </ser:validate> </soapenv:Body> </soapenv:Envelope>""" data = body # headers = {'Content-Type': 'application/soap+xml; charset=utf-8'} headers = {'content-type': 'text/xml'} req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) the_page = response.read() print(the_page) ```

By Aliaksandr Samuseu staff 21 Apr 2017 at 10:14 a.m. CDT

Aliaksandr Samuseu gravatar
Please try to use catch-all exception handlers to register possible exceptions it throws.

By Aliaksandr Samuseu staff 21 Apr 2017 at 1:10 p.m. CDT

Aliaksandr Samuseu gravatar
I've just thought that as you are most likely using some url in thi POST request, you may face some name resolution problem. If I got it right, here is your url: `http://abc.domain.com/Service/services/ServiceImpl?wsdl`, correct? Please try to run this then - `# ping abc.domain.com` - **from inside the container**. By default `8.8.8.8` usually is set as DNS server in the container. If external DNS servers are blocked in your network, this may cause the issue.

By Wilbur Pereira user 21 Apr 2017 at 1:23 p.m. CDT

Wilbur Pereira gravatar
When I executed the script from the same server in a python prompt it worked. It just does not work in Gluu.

By Mohib Zico staff 26 Apr 2017 at 3:19 p.m. CDT

Mohib Zico gravatar
Wilbur, Custom script troubleshooting is not included in community support; however we are keeping your attached script to test. Will test it if our QA team can manage some time for this.

By Wilbur Pereira user 10 May 2017 at 4:20 a.m. CDT

Wilbur Pereira gravatar
Thanks. After a lot of hair splitting over this, we have identified that Jython does not support SOAP requests. We will now have to convert our SOAP WS to REST API and that as per our tests are supported in jython.

By Aliaksandr Samuseu staff 10 May 2017 at 10:35 a.m. CDT

Aliaksandr Samuseu gravatar
Hi, Wilbur. > we have identified that Jython does not support SOAP requests That's unexpected. Are you sure about it? Could you refer some discussion or article which backup this finding? Or did you mean that default jython distribution which pre-packaged with Gluu, is not enough to issue SOAP request, perhaps? Please note that you can also download 3rd party Python libraries inside your container if you need more functionality.

By Wilbur Pereira user 11 May 2017 at 4:37 a.m. CDT

Wilbur Pereira gravatar
I tried replacing the stock jython jar with the latest version i.e. 2.7.0 and tried posting a SOAP request and it kept throwing exceptions. Also, tried googling extensively and did not find any substantial snippets/code/stuff on SOAP requests using jython. We are a java shop and have a very little understanding of Python and so are struggling with the customization.

By Michael Schwartz Account Admin 05 Dec 2018 at 4:16 a.m. CST

Michael Schwartz gravatar
If you prefer to use Java, you can import java classes directly. You can also include your custom war files. The syntax for the scripts is Python, but many Gluu Server admins use primarily java to define the business logic in these authentication scripts.