oauth acting strangely on preview server

9 views
Skip to first unread message

M@hdeTo

unread,
Dec 2, 2010, 6:14:38 AM12/2/10
to Google Wave API
I had this application working using the active robot api, I am using
the java client library. I get a report that its not working as
intended.

I checked the dashboard only to find this exception:

/_wave/robot/jsonrpc
java.lang.IllegalArgumentException: No consumer key is found for the
RPC server URL:
at
com.google.wave.api.AbstractRobot.deserializeEvents(AbstractRobot.java:
742)
at com.google.wave.api.AbstractRobot.processRpc(AbstractRobot.java:
577)
at com.google.wave.api.AbstractRobot.doPost(AbstractRobot.java:317)

I went through the oauth registration process again just to get the
same old consumer key and secret.

I updated to the latest api libraries (v2-20101119) problem still
persisted.
I looked into the source code and the only way this could happen is if
the event bundle rpc server url was different from the one I used
Preview: "http://www-opensocial.googleusercontent.com/api/rpc"

At this point I realize that bundle.getRpcServerUrl() returns an empty
string.

I trace around some more and found that this check could be bypassed
by setting setAllowUnsignedRequests(true);

after which I got a very weird exception on the dashboard:

/_wave/robot/jsonrpc
com.google.gson.JsonParseException: Failed parsing JSON source:
java.io.StringReader@57dc15 to Json
at com.google.gson.JsonParser.parse(JsonParser.java:57)
at com.google.gson.Gson.fromJson(Gson.java:443)
at com.google.gson.Gson.fromJson(Gson.java:396)
at com.google.gson.Gson.fromJson(Gson.java:372)
at com.google.wave.api.WaveService.makeRpc(WaveService.java:752)
at com.google.wave.api.WaveService.submit(WaveService.java:446)

At this point I comment out all my robot's code and turn it into a
hello world robot

@Override
@Capability(contexts={Context.ALL})
public void onWaveletParticipantsChanged(
WaveletParticipantsChangedEvent event) {
for (String newParticipant : event.getParticipantsAdded()) {
if (!newParticipant.equals(ROBOT_ID)) {
event.getWavelet().reply("\nHi : " + newParticipant);
try {
submit(event.getWavelet(), WaveService.RPC_URL);
} catch (IOException e) {
ExceptionHelper.log(log, "couldn't reply", e);
}
}
}
}

I'd still get the same exception.

Another look in the log and I find this:

com.google.wave.api.WaveService makeRpc: Response returned:
<HTML><HEAD><TITLE>OAuth Authentication FailureOAuth Authentication
Failure</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"><H1>OAuth
Authentication FailureOAuth Authentication Failure</H1><H2>Error 401</
H2></BODY></HTML>

Any advice on how to resolve/workaround this?
Reply all
Reply to author
Forward
0 new messages