GluuFederation / oxAuth

OAuth 2.0 server and client; OpenID Connect Provider (OP) & UMA Authorization Server (AS)
https://gluu.org/docs/ce
MIT License
424 stars 150 forks source link

Phone number verification message for Twilio #589

Closed mzico closed 5 years ago

mzico commented 7 years ago

Twilio should 'verify' phone number and throw proper message than logging python exception.

Here is one sample example:

User didn't have any mobile number associated with his account. When he tried to log into Gluu Server with Twilio, below error came in oxauth_script:

2017-07-13 09:53:19,547 TRACE [oxAuthScheduler_Worker-3] [org.xdi.service.custom.script.CustomScriptManager] (CustomScriptManager.java:122) - Last finished time '2017-07-13T09:53:19.547+0000'
2017-07-13 09:53:22,183 DEBUG [qtp242131142-19] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:238) - Executing python 'getPageForStep' authenticator method
2017-07-13 09:53:24,624 DEBUG [qtp242131142-10] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:328) - Validating acr_values: 'twilio_sms'
2017-07-13 09:53:24,624 DEBUG [qtp242131142-10] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:123) - Executing python 'isValidAuthenticationMethod' authenticator method
2017-07-13 09:53:24,625 DEBUG [qtp242131142-10] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:212) - Executing python 'prepareForStep' authenticator method
2017-07-13 09:53:24,627 INFO  [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:208) - TwilioSMS. Prepare for Step 1
2017-07-13 09:53:24,627 DEBUG [qtp242131142-10] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:225) - Executing python 'getExtraParametersForStep' authenticator method
2017-07-13 09:53:46,441 DEBUG [qtp242131142-19] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:162) - Executing python 'authenticate' authenticator method
2017-07-13 09:53:46,445 INFO  [qtp242131142-19] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:208) - TwilioSMS. form_response_passcode: None
2017-07-13 09:53:46,445 INFO  [qtp242131142-19] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:208) - TwilioSMS. Step 1 Password Authentication
2017-07-13 09:53:46,670 ERROR [qtp242131142-19] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:167) - null
org.python.core.PyException: null
        at org.python.core.Py.JavaError(Py.java:546) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject._jthrow(PyObject.java:3653) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject._jcall(PyObject.java:3660) ~[jython-2.7.0.jar:?]
        at org.python.proxies.__builtin__$PersonAuthentication$10.authenticate(Unknown Source) ~[?:?]
        at org.xdi.oxauth.service.external.ExternalAuthenticationService.executeExternalAuthenticate(ExternalAuthenticationService.java:165) [classes/:?]
        at org.xdi.oxauth.service.external.ExternalAuthenticationService$Proxy$_$$_WeldSubclass.executeExternalAuthenticate$$super(Unknown Source) [classes/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
        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.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$InterceptorAction.proceed(InvocationMonitor.java:198) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$InterceptorAction.proceed(InvocationMonitor.java:194) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor.monitor(InvocationMonitor.java:139) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at sun.reflect.GeneratedMethodAccessor45.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.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:73) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:85) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:73) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:57) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.xdi.oxauth.service.external.ExternalAuthenticationService$Proxy$_$$_WeldSubclass.executeExternalAuthenticate(Unknown Source) [classes/:?]
        at org.xdi.oxauth.service.external.ExternalAuthenticationService$Proxy$_$$_WeldClientProxy.executeExternalAuthenticate(Unknown Source) [classes/:?]
        at org.xdi.oxauth.auth.Authenticator.userAuthenticationInteractive(Authenticator.java:249) [classes/:?]
        at org.xdi.oxauth.auth.Authenticator.authenticateImpl(Authenticator.java:139) [classes/:?]
        at org.xdi.oxauth.auth.Authenticator$Proxy$_$$_WeldSubclass.authenticateImpl(Unknown Source) [classes/:?]
        at org.xdi.oxauth.auth.Authenticator.authenticate(Authenticator.java:102) [classes/:?]
        at org.xdi.oxauth.auth.Authenticator$Proxy$_$$_WeldSubclass.authenticate$$super(Unknown Source) [classes/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
        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.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$InterceptorAction.proceed(InvocationMonitor.java:198) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$InterceptorAction.proceed(InvocationMonitor.java:194) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor.monitor(InvocationMonitor.java:139) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at sun.reflect.GeneratedMethodAccessor45.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.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:73) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:85) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:73) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:57) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68) [weld-core-impl-3.0.0.Final.jar:3.0.0.Final]
        at org.xdi.oxauth.auth.Authenticator$Proxy$_$$_WeldSubclass.authenticate(Unknown Source) [classes/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
        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.apache.el.parser.AstValue.invoke(AstValue.java:247) [org.mortbay.jasper.apache-el-8.0.33.jar:8.0.33]
        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267) [org.mortbay.jasper.apache-el-8.0.33.jar:8.0.33]
        at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-web-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-web-3.0.0.Final.jar:3.0.0.Final]
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.2.14.jar:2.2.14]
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) [jsf-api-2.2.14.jar:2.2]
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.2.14.jar:2.2.14]
        at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jsf-api-2.2.14.jar:2.2]
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jsf-api-2.2.14.jar:2.2]
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) [jsf-api-2.2.14.jar:2.2]
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.14.jar:2.2.14]
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.14.jar:2.2.14]
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.14.jar:2.2.14]
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) [jsf-api-2.2.14.jar:2.2]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:329) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:312) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.ProbeFilter$FilterAction.doFilter(ProbeFilter.java:338) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.ProbeFilter.embedInfoSnippet(ProbeFilter.java:188) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.jboss.weld.probe.ProbeFilter.doFilter(ProbeFilter.java:176) [weld-probe-core-3.0.0.Final.jar:3.0.0.Final]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) [jetty-security-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:199) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:74) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:42) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
        at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:297) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
        at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:198) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.xdi.oxauth.audit.debug.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:55) [classes/:?]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
Caused by: com.twilio.sdk.TwilioRestException: A 'To' phone number is required.
        at com.twilio.sdk.TwilioRestException.parseResponse(TwilioRestException.java:74) ~[twilio-java-sdk-6.3.0.jar:?]
        at com.twilio.sdk.TwilioClient.safeRequest(TwilioClient.java:497) ~[twilio-java-sdk-6.3.0.jar:?]
        at com.twilio.sdk.resource.list.MessageList.create(MessageList.java:70) ~[twilio-java-sdk-6.3.0.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
        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.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) ~[jython-2.7.0.jar:?]
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject.__call__(PyObject.java:478) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject.__call__(PyObject.java:482) ~[jython-2.7.0.jar:?]
        at org.python.core.PyMethod.__call__(PyMethod.java:141) ~[jython-2.7.0.jar:?]
        at org.python.pycode._pyx10.authenticate$8(<iostream>:172) ~[?:?]
        at org.python.pycode._pyx10.call_function(<iostream>) ~[?:?]
        at org.python.core.PyTableCode.call(PyTableCode.java:167) ~[jython-2.7.0.jar:?]
        at org.python.core.PyBaseCode.call(PyBaseCode.java:307) ~[jython-2.7.0.jar:?]
        at org.python.core.PyBaseCode.call(PyBaseCode.java:198) ~[jython-2.7.0.jar:?]
        at org.python.core.PyFunction.__call__(PyFunction.java:482) ~[jython-2.7.0.jar:?]
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237) ~[jython-2.7.0.jar:?]
        at org.python.core.PyMethod.__call__(PyMethod.java:228) ~[jython-2.7.0.jar:?]
        at org.python.core.PyMethod.__call__(PyMethod.java:218) ~[jython-2.7.0.jar:?]
        at org.python.core.PyMethod.__call__(PyMethod.java:213) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject._jcallexc(PyObject.java:3626) ~[jython-2.7.0.jar:?]
        at org.python.core.PyObject._jcall(PyObject.java:3658) ~[jython-2.7.0.jar:?]
        ... 119 more
2017-07-13 09:53:46,679 DEBUG [qtp242131142-19] [org.xdi.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:251) - Executing python 'getApiVersion' authenticator method
2017-07-13 09:53:49,548 TRACE [oxAuthScheduler_Worker-2] [org.xdi.service.custom.script.CustomScriptManager] (CustomScriptManager.java:122) - Last finished time '2017-07-13T09:53:49.548+0000'
yurem commented 5 years ago

@mzico @sahiliamsso It's old issue. Can you review if it throw same error in 3.1.5

yurem commented 5 years ago

@mzico can you check latest script https://github.com/GluuFederation/oxAuth/blob/version_3.1.6/Server/integrations/twilio_sms/twilio2FA.py in 3.1.5?

sahilIT2020 commented 5 years ago

Now I am getting Failed to authenticate.

Traceback (most recent call last): File "twilio_sms.py", line 181, in authenticate NameError: global name 'facesMessage' is not defined at org.python.core.Py.NameError(Py.java:290) at org.python.core.PyFrame.getglobal(PyFrame.java:265) at org.python.pycode._pyx11.authenticate$8(twilio_sms.py:187) at org.python.pycode._pyx11.call_function(twilio_sms.py) at org.python.core.PyTableCode.call(PyTableCode.java:171) at org.python.core.PyBaseCode.call(PyBaseCode.java:308) at org.python.core.PyBaseCode.call(PyBaseCode.java:199) at org.python.core.PyFunction.call(PyFunction.java:482) at org.python.core.PyMethod.instancemethod_call(PyMethod.java:237) at org.python.core.PyMethod.call(PyMethod.java:228) at org.python.core.PyMethod.call(PyMethod.java:218) at org.python.core.PyMethod.call(PyMethod.java:213) at org.python.core.PyObject._jcallexc(PyObject.java:3644) at org.python.core.PyObject.jcall(PyObject.java:3676) at org.python.proxies.builtin$PersonAuthentication$12.authenticate(Unknown Source) at org.xdi.oxauth.service.external.ExternalAuthenticationService.executeExternalAuthenticate(ExternalAuthenticationService.java:174) at org.xdi.oxauth.service.external.ExternalAuthenticationService$Proxy$$$_WeldClientProxy.executeExternalAuthenticate(Unknown Source) at org.xdi.oxauth.auth.Authenticator.userAuthenticationInteractive(Authenticator.java:306) at org.xdi.oxauth.auth.Authenticator.authenticateImpl(Authenticator.java:192) at org.xdi.oxauth.auth.Authenticator.authenticate(Authenticator.java:126) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.el.parser.AstValue.invoke(AstValue.java:247) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267) at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) at javax.faces.component.UICommand.broadcast(UICommand.java:315) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.xdi.oxauth.audit.debug.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:55) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:503) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Thread.java:748)

   

yurem commented 5 years ago

Can you try updated script: https://github.com/GluuFederation/community-edition-setup/blob/version_3.1.6/static/extension/person_authentication/twilio2FA.py ?

sahilIT2020 commented 5 years ago

Yes it is working fine now. Thanks