JanssenProject / jans

An open source enterprise digital identity platform for CIAM or workforce... Janssen is a distribution of standards-based, developer friendly, components that are engineered to work together in any cloud. #OAuth #OpenID #FIDO
https://docs.jans.io
Apache License 2.0
439 stars 73 forks source link

Twilio script failed during login. #819

Open MohitMaliFtechiz opened 2 years ago

MohitMaliFtechiz commented 2 years ago

Describe the bug

twilio script failed during login.

To Reproduce Steps to reproduce the behavior:

  1. Go to jans-cli.
  2. Create a test client.
  3. Enable twilio script.
  4. Change the Default acr to twilio.
  5. Test oidc sso in private browsing mode.

Expected behavior

login should be performed.

**Actual behavior***

jans-auth throws error.

Desktop (please complete the following information):

Logs

2022-02-10 12:43:09,289 ERROR [Jans AuthScheduler_Worker-3]  [io.jans.service.PythonService] (PythonService.java:186) - Failed to load python file
org.python.core.PyException: ImportError: No module named twilio
    at org.python.core.Py.ImportError(Py.java:329) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.imp.import_logic(imp.java:1290) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.imp.import_module_level(imp.java:1369) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.imp.importName(imp.java:1528) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.ImportFunction.__call__(__builtin__.java:1285) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.PyObject.__call__(PyObject.java:433) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.__builtin__.__import__(__builtin__.java:1232) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.imp.importOneAs(imp.java:1564) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.pycode._pyx11.f$0(twilio_sms.py:29) ~[?:?]
    at org.python.pycode._pyx11.call_function(twilio_sms.py) ~[?:?]
    at org.python.core.PyTableCode.call(PyTableCode.java:173) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.PyCode.call(PyCode.java:18) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.core.Py.runCode(Py.java:1687) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:297) ~[jython-standalone-2.7.3.jar:2.7.3-SNAPSHOT]
    at io.jans.service.PythonService.loadPythonScript(PythonService.java:184) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.PythonService$Proxy$_$$_WeldClientProxy.loadPythonScript(Unknown Source) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.createExternalTypeFromStringWithPythonException(CustomScriptManager.java:410) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager$Proxy$_$$_WeldSubclass.createExternalTypeFromStringWithPythonException(Unknown Source) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.createExternalType(CustomScriptManager.java:378) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.reloadCustomScriptConfigurations(CustomScriptManager.java:286) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.reloadImpl(CustomScriptManager.java:183) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.reload(CustomScriptManager.java:153) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager.reloadTimerEvent(CustomScriptManager.java:129) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.custom.script.CustomScriptManager$Proxy$_$$_WeldSubclass.reloadTimerEvent(Unknown Source) [jans-core-script-1.0.0-SNAPSHOT.jar:?]
    at jdk.internal.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:168) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124) [jakarta.enterprise.cdi-api-2.0.2.jar:?]
    at org.jboss.weld.util.Observers.notify(Observers.java:166) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:159) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:632) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at org.jboss.weld.util.ForwardingBeanManager.fireEvent(ForwardingBeanManager.java:104) [weld-core-impl-3.1.8.Final.jar:3.1.8.Final]
    at io.jans.service.timer.TimerJob.execute(TimerJob.java:45) [jans-core-timer-weld-1.0.0-SNAPSHOT.jar:?]
    at io.jans.service.timer.JobExecutionDelegate.execute(JobExecutionDelegate.java:37) [jans-core-timer-weld-1.0.0-SNAPSHOT.jar:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.2.jar:?]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?]
2022-02-10 12:43:09,296 ERROR [Jans AuthScheduler_Worker-3]  [io.jans.service.custom.script.CustomScriptManager] (CustomScriptManager.java:380) - Failed to prepare external type 'io.jans.exception.PythonException: Failed to load python file 'java.io.ByteArrayInputStream@32295ad5''
MohitMaliFtechiz commented 2 years ago

twilio.zip Full logs attached here.

jgomer2001 commented 2 years ago

did you copy the twilio jar to custom/lib @MohitMaliFtechiz ?

ossdhaval commented 8 months ago

Hi @MohitMaliFtechiz, I found this old issue still open. Can you check if this behavior still exists and if we need to fix it?

MohitMaliFtechiz commented 6 months ago

hi @ossdhaval ok let me check this issue again on latest build