How to use GWT-RPC proxies with HTTP Basic authentication

322 views
Skip to first unread message

nicolas.deloof

unread,
Jul 8, 2008, 9:45:17 AM7/8/08
to Google Web Toolkit
Hello

My GWT (1.5RC1) application starts by asking user credentials. All GWT-
RPC calls need to pass them as HTTP Basic authentication to the server
for security purpose.

I've noticed the RequestBuilder.setUser() and setPassword() methods,
but don't know how to use them from a GWT-rpc proxy. Is there any
interface the proxy implements I can use to set them ? Any global
attribute all proxies will use ?

Best regards,
Nicolas

Jason Essington

unread,
Jul 8, 2008, 10:02:20 AM7/8/08
to Google-We...@googlegroups.com
rather than returning void in your async interface, return
RequestBuilder. then when you call your method, you'll receive the
request builder, which you can then set the user and password, and
fire the request yourself.

-jason

walden

unread,
Jul 9, 2008, 7:26:06 AM7/9/08
to Google Web Toolkit
Just a note here that if you would let your server issue the
authentication challenge, and let your user login with the browser's
login dialog, then the rest would be seamless and transparent to you,
as the credentials would automatically be tacked on to each RPC (or
other) request you make subsequently.

Walden
Reply all
Reply to author
Forward
0 new messages