Hello,
Does anyone know how to use Restlet in combination with OAUTH? I
searched the web and did not found any useful documentations or
tutorial. Seems like this is not supported anymore?
What I want to do is connecting Android to Google App engine, where I
use Google Accounts for authentication.
Here is my Restlet Server Code:
public class UploadServerApplication extends Application {
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
getConnectorService().getClientProtocols().add(Protocol.FILE);
router.attachDefault(UploadServerResource.class);
return router;
}
}
Resource:
UploadServerResource extends ServerResource implements UploadResource
{
public UploadResult upload(UploadData uploadData) {
UserService userServiceManager =
UserServiceFactory.getUserService();
boolean authenticated = userServiceManager.isUserLoggedIn();<---
always false in my tests!
if (authenticated) { ... result.setSuccess(true); }
else { ...result.setSuccess(false); }
return result;
}
-------------------------------------------------------------------------
Android client code:
ClientResource cr = new ClientResource("http://192.168.1.4:8888/
upload");
UploadResource resource = cr.wrap(UploadResource.class);
UploadData uploadData = new UploadData();
...
UploadResult result = resource.uploadTrack(uploadData);
...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en