gwt-syncproxy icon indicating copy to clipboard operation
gwt-syncproxy copied to clipboard

gwt-syncproxy fails when the server has BASIC AUTHENTICATION

Open GoogleCodeExporter opened this issue 10 years ago • 5 comments

What steps will reproduce the problem?
1. I have a GWT backend server and use BAISC AUTHENTICATION
2. I use gwt-syncproxy  in an android client
3. gwt-syncproxy fails to get the *.nocache.js as it does not pass the security 
credentials

How do I make gwt-syncproxy pass the security credentials to the server.

Original issue reported on code.google.com by [email protected] on 10 Jan 2014 at 6:02

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter

Hello, I have the same problème with my android client. I use gwt-syncproxy 
librairie to acces to my remote LoginService interface.   And the following 
warning occured:

RpcPolicyFinder:No RemoteService in the classpath , followed by : 

java.io.FileNotFoundException: http://10.0.2.2:8181/gui/application.nocache.js 

How can i fix this ? Thanks  for your help :)

Original comment by [email protected] on 26 May 2014 at 3:11

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter

Original comment by [email protected] on 26 May 2014 at 3:11

Attachments:

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter

As follow-up to this issue, please see this post: 
https://groups.google.com/forum/#!topic/google-web-toolkit/hK49qRH5juY. With 
that in mind, if this feature is still needed, I will look into implemented the 
described process to make it available, although not recommended. Please verify 
the continuning need for providing AUTH credentials.

Original comment by [email protected] on 28 May 2014 at 12:50

  • Changed state: Pending

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter

I don't think the setRpcRequestBuilder method works:

- when I call SyncProxy.newProxyInstance (before I can replace the 
RpcRequestBuilder), SyncProxy already tries (and fails) to fetch the policy file

java.io.IOException: Server returned HTTP response code: 401 for URL: 
http://localhost:11080/Console/Console.nocache.js
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1838)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
    at com.gdevelop.gwt.syncrpc.RpcPolicyFinder.getResposeText(RpcPolicyFinder.java:123)
    at com.gdevelop.gwt.syncrpc.RpcPolicyFinder.fetchSerializationPolicyName(RpcPolicyFinder.java:71)
    at com.gdevelop.gwt.syncrpc.SyncProxy.newProxyInstance(SyncProxy.java:236)

- after getting an instance of my service, how can I set a new 
RpcRequestBuilder??

((ServiceDefTarget) consoleService).setRpcRequestBuilder(newRequestBuilder) 

=> java.lang.ClassCastException: com.sun.proxy.$Proxy3 cannot be cast to 
com.google.gwt.user.client.rpc.ServiceDefTarget

Original comment by [email protected] on 7 Jan 2015 at 2:02

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter

@boris You are correct, SyncProxy was initially not designed to handle the 
features of the ServiceDefTarget interface, specifically that of setting a 
custom Request or RequestBuilder. As of version 0.5 (to be released in a few 
days), I have added support for the ServiceDefTarget interface, but I have not 
yet had time to support the specific features of Request or RequestBuilder. I 
plan on adding that support in 0.6, but it will be a few months before I can 
spare time for this project again for that level of development. If you can, 
please provide some additional context in your usage of a custom 
RequestBuilder...Also please note that if it is the context of Basic 
Authentication, this is not recommended as per the link in comment 3. Please 
check back this weekend to review the release notes for the 0.5 release as 
there are some significant changes to make it more compatible with current and 
upcoming versions of GWT.

Original comment by [email protected] on 7 Jan 2015 at 7:28

GoogleCodeExporter avatar Mar 21 '15 02:03 GoogleCodeExporter