[Carbon-dev] AuthenticationAdminClient login used in webapp in AS 4.1.0 fails

Guillaume Devianne gdevianne at gmail.com
Wed Jul 27 21:00:16 EDT 2011


created a jira https://wso2.org/jira/browse/CARBON-11039
<https://wso2.org/jira/browse/CARBON-11039>
Guillaume


On Wed, Jul 27, 2011 at 7:18 PM, Guillaume Devianne <gdevianne at gmail.com>wrote:

> I edited the jsp as follow
> 33:     String serverURL =
> config.getServletContext().getInitParameter("webServiceServerURL");
> 34:     serverURL="https://172.30.10.247:9444/services/";
>
> and it worked correctly
>
> so the problem comes from
> the config.getServletContext().getInitParameter("webServiceServerURL") that
> does not take the <portOffset> para into account
>
>
> Guillaume Devianne
> 08-428.1651
>
>
> On Wed, Jul 27, 2011 at 6:49 PM, Guillaume Devianne <gdevianne at gmail.com>wrote:
>
>> Afkham,
>>
>> After the change, i cannot see the output as it is a jsp and ,in the
>> browser, it returns the error.
>>
>>
>> Now, in the log, i can see the following:
>>
>> *TID: [0] [WSO2 Application Server] [2011-07-27 18:38:21,626]  INFO
>> {org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
>> url[https://172.30.10.247:9443/services/AuthenticationAdmin]
>> {org.apache.axis2.transport.http.HTTPSender}*
>> *java.net.ConnectException: Connection refused*
>>
>>
>> And here is the error.
>>
>> the port says : 9443 for https
>> but
>> I am using the <Offset>1</Offset>  (which is so great !!)
>>
>> so, apparently, the port offset is not taken into account in that class.
>>
>> Guillaume Devianne
>> 08-428.1651
>>
>>
>> On Wed, Jul 27, 2011 at 5:51 PM, Afkham Azeez <azeez at wso2.com> wrote:
>>
>>> Can you edit this login.jsp as follows:
>>>
>>> 33:     String serverURL =
>>> config.getServletContext().getInitParameter("webServiceServerURL");
>>> 34:     System.out.println("serverURL="+ serverURL);
>>>
>>> and see what is the serverURL that is being used?
>>>
>>>
>>> On Wed, Jul 27, 2011 at 11:34 PM, Guillaume Devianne <
>>> gdevianne at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have wso2as-4.1.0 installed with Active Directory as the User Store.
>>>>
>>>> I succesfully login to the management interface with my Active Directory
>>>> Username and password.
>>>>
>>>> When I try the webapp example located at http://server:port
>>>> /example/carbon/authentication/index.jsp,
>>>>
>>>> it fails with the error :
>>>>
>>>> [2011-07-27 14:05:14,196] ERROR
>>>> {org.apache.catalina.core.ContainerBase.[Tomcat].[defaulthost].[/example].[jsp]}
>>>> -  Servlet.service() for servlet [jsp] in context with path [/example] threw
>>>> exception [An exception occurred processing JSP page
>>>> /carbon/authentication/login.jsp at line 36
>>>>
>>>> 33:     String serverURL =
>>>> config.getServletContext().getInitParameter("webServiceServerURL");
>>>> 34:     AuthenticationAdminClient authAdmin =
>>>> 35:             new AuthenticationAdminClient(configCtx, serverURL,
>>>> null, session, true);
>>>> 36:     boolean status = authAdmin.login(username, password,
>>>> request.getRemoteAddr());
>>>> 37:     if (status) {
>>>> 38:         session.setAttribute("logged-in", "true");
>>>> 39:         session.setAttribute("username", username);
>>>>
>>>>
>>>> Stacktrace:] with root cause
>>>> java.net.ConnectException: *Connection refused*
>>>>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>>         at
>>>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
>>>>         at
>>>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
>>>>         at
>>>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
>>>>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
>>>>         at java.net.Socket.connect(Socket.java:546)
>>>>         at
>>>> sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:579)
>>>>         at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
>>>>         at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:616)
>>>>         at
>>>> org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
>>>>         at
>>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
>>>>         at
>>>> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
>>>>         at
>>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
>>>>         at
>>>> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
>>>>         at
>>>> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
>>>>         at
>>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>>>>         at
>>>> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
>>>>         at
>>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
>>>>         at
>>>> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
>>>>         at
>>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:449)
>>>>         at
>>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:276)
>>>>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
>>>>         at
>>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
>>>>         at
>>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>>>>         at
>>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
>>>>         at
>>>> org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
>>>>         at
>>>> org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient.login(AuthenticationAdminClient.java:64)
>>>>         at
>>>> org.apache.jsp.carbon.authentication.login_jsp._jspService(login_jsp.java:94)
>>>>         at
>>>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>>         at
>>>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
>>>>         at
>>>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
>>>>         at
>>>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>>         at
>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
>>>>         at
>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>         at
>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
>>>>         at
>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
>>>>         at
>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
>>>>         at
>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
>>>>         at
>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
>>>>         at
>>>> org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:241)
>>>>         at
>>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>>>>         at
>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>         at
>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
>>>>         at
>>>> org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
>>>>         at
>>>> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
>>>>         at
>>>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
>>>>         at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>         at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>         at java.lang.Thread.run(Thread.java:636)
>>>>
>>>>
>>>>
>>>> Do I have to add rights to an anonymous user of some sort?
>>>> should I add users to the everyone role?
>>>>
>>>> It is quite important for me to make it work as I have created an
>>>> apolication that uses that functionality.
>>>> It worked on my local copy of AS, the difference being that I had not
>>>> conected that AS to the Active Directory.
>>>>
>>>> I would appreciate looking into this.
>>>> Thanks
>>>>
>>>>
>>>> Guillaume Devianne
>>>> 08-428.1651
>>>>
>>>> _______________________________________________
>>>> Carbon-dev mailing list
>>>> Carbon-dev at wso2.org
>>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * <http://www.apache.org/>**
>>> email: **azeez at wso2.com* <azeez at wso2.com>* cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>> _______________________________________________
>>> Carbon-dev mailing list
>>> Carbon-dev at wso2.org
>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.wso2.org/pipermail/carbon-dev/attachments/20110727/03b7bb88/attachment-0001.html>


More information about the Carbon-dev mailing list