[appengine-java] Re: AuthSub InvalidToken problem

2010-04-03 Thread nicanor.babula
Thank you very much. By comparing your code to mine, I found where the
error was.

Cristian Babula.

On Mar 31, 5:37 pm, m seleron  wrote:
> Hi,
>
> I made a simple sample.
>
> Please try.
> I hope I can be of some help to you.
>
> thanks.
>
> 2010/3/31 nicanor.babula :
>
> > Hmm? No idea? ;)
> > Thanks in advance.
>
> > On Mar 30, 10:06 am, "nicanor.babula" 
> > wrote:
> >> That's all the code that deals with google services in my whole
> >> application. The exception is raised on the following instruction:
> >> [code]
> >> CalendarEventFeed resultFeed = calendarService.query(myQuery,
> >> CalendarEventFeed.class);
> >> [/code]
>
> >> What about the environment? You are saying that I might have included
> >> jars that could interfere with auth sub? Are there any known
> >> conflictual libraries? I have simply included all the jars shipped
> >> with the gdata-samples package.
>
> >> On Mar 30, 4:51 am, seleronm  wrote:
>
> >> > Hi,
>
> >> > I was not able to have them reproduce behavior though I tried a
> >> > little.
> >> > (It was possible to execute it normally).
>
> >> > Can post do you the source code further?
> >> > I want to confirm behavior.
>
> >> > Or, the environment might be a cause.
>
> >> > thank.
>
> >> > > Come on!
> >> > > Anyone, anything?
>
> >> > > Thanks.
>
> >> > > On Mar 26, 12:54 pm, "nicanor.babula" 
> >> > > wrote:
>
> >> > > > Hi all,
>
> >> > > > I am facing a strange problem in with my app in GAE and I can't seem
> >> > > > to figure it up by myself, so I hope you'll help me.. Here we are:
>
> >> > > > I do :
>
> >> > > > [code]
> >> > > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> >> > > > "http://www.google.com/calendar/feeds/default/private/full";, false, 
> >> > > > true);
> >> > > > response.sendRedirect(authSubUrl);
> >> > > > [/code]
>
> >> > > > in my servlet in order to get an auth subtoken. And the servlet at
> >> > > > nextUrl does:
> >> > > > [code]
> >> > > > String oneTimeUseToken =
> >> > > > AuthSubUtil.getTokenFromReply(request.getQueryString());
> >> > > > if(oneTimeUseToken != null){
> >> > > >   String sessionToken =
> >> > > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
> >> > > >   // persist the sessiontoken}
>
> >> > > > // redirect to the page using google services
> >> > > > [/code]
> >> > > > in order to retrieve and persist the sessiontokenalong with other
> >> > > > user information.
>
> >> > > > The problem is that when later I do:
> >> > > > [code]
> >> > > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> >> > > > private/full");
> >> > > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
> >> > > > CalendarService calendarService = new CalendarService("some-app-
> >> > > > name");
> >> > > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
> >> > > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
> >> > > > CalendarEventFeed.class);
> >> > > > [/code]
>
> >> > > > It says that thetokenisinvalid, and raises this exception:
> >> > > > [code]
> >> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> >> > > > null
> >> > > > com.google.gdata.util.AuthenticationException: OK
> >> > > > 
> >> > > > 
> >> > > > Tokeninvalid-InvalidAuthSubtoken.
> >> > > > 
> >> > > > 
> >> > > > Tokeninvalid-InvalidAuthSubtoken.
> >> > > > Error 401
> >> > > > 
> >> > > > 
>
> >> > > >         at
> >> > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
> >> > > >  Request.java:
> >> > > > 596)
> >> > > >         at
> >> > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
> >> > > >  DataRequest.java:
> >> > > > 563)
> >> > > >         at
> >> > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
> >> > > >  t.java:
> >> > > > 550)
> >> > > >         at
> >> > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
> >> > > >  :
> >> > > > 530)
> >> > > >         at
> >> > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
> >> > > >  java:
> >> > > > 535)
> >> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
> >> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
> >> > > >         at 
> >> > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> >> > > > 662)
> >> > > >         at com.google.gdata.client.Service.query(Service.java:1204)
> >> > > >         at com.google.gdata.client.Service.query(Service.java:1145)
> >> > > >         at
> >> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
> >> > > >  ventsServiceImpl.java:
> >> > > > 133)
> >> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> >> > > > Method)
> >> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
> >> > > > Source)
> >> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> >> > > > Source)
> 

Re: [appengine-java] Re: AuthSub InvalidToken problem

2010-03-31 Thread m seleron
Hi,

I made a simple sample.

Please try.
I hope I can be of some help to you.

thanks.


2010/3/31 nicanor.babula :
> Hmm? No idea? ;)
> Thanks in advance.
>
> On Mar 30, 10:06 am, "nicanor.babula" 
> wrote:
>> That's all the code that deals with google services in my whole
>> application. The exception is raised on the following instruction:
>> [code]
>> CalendarEventFeed resultFeed = calendarService.query(myQuery,
>> CalendarEventFeed.class);
>> [/code]
>>
>> What about the environment? You are saying that I might have included
>> jars that could interfere with auth sub? Are there any known
>> conflictual libraries? I have simply included all the jars shipped
>> with the gdata-samples package.
>>
>> On Mar 30, 4:51 am, seleronm  wrote:
>>
>> > Hi,
>>
>> > I was not able to have them reproduce behavior though I tried a
>> > little.
>> > (It was possible to execute it normally).
>>
>> > Can post do you the source code further?
>> > I want to confirm behavior.
>>
>> > Or, the environment might be a cause.
>>
>> > thank.
>>
>> > > Come on!
>> > > Anyone, anything?
>>
>> > > Thanks.
>>
>> > > On Mar 26, 12:54 pm, "nicanor.babula" 
>> > > wrote:
>>
>> > > > Hi all,
>>
>> > > > I am facing a strange problem in with my app in GAE and I can't seem
>> > > > to figure it up by myself, so I hope you'll help me.. Here we are:
>>
>> > > > I do :
>>
>> > > > [code]
>> > > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
>> > > > "http://www.google.com/calendar/feeds/default/private/full";, false, 
>> > > > true);
>> > > > response.sendRedirect(authSubUrl);
>> > > > [/code]
>>
>> > > > in my servlet in order to get an auth subtoken. And the servlet at
>> > > > nextUrl does:
>> > > > [code]
>> > > > String oneTimeUseToken =
>> > > > AuthSubUtil.getTokenFromReply(request.getQueryString());
>> > > > if(oneTimeUseToken != null){
>> > > >   String sessionToken =
>> > > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
>> > > >   // persist the sessiontoken}
>>
>> > > > // redirect to the page using google services
>> > > > [/code]
>> > > > in order to retrieve and persist the sessiontokenalong with other
>> > > > user information.
>>
>> > > > The problem is that when later I do:
>> > > > [code]
>> > > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
>> > > > private/full");
>> > > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
>> > > > CalendarService calendarService = new CalendarService("some-app-
>> > > > name");
>> > > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
>> > > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
>> > > > CalendarEventFeed.class);
>> > > > [/code]
>>
>> > > > It says that thetokenisinvalid, and raises this exception:
>> > > > [code]
>> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
>> > > > null
>> > > > com.google.gdata.util.AuthenticationException: OK
>> > > > 
>> > > > 
>> > > > Tokeninvalid-InvalidAuthSubtoken.
>> > > > 
>> > > > 
>> > > > Tokeninvalid-InvalidAuthSubtoken.
>> > > > Error 401
>> > > > 
>> > > > 
>>
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
>> > > >  Request.java:
>> > > > 596)
>> > > >         at
>> > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
>> > > >  DataRequest.java:
>> > > > 563)
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
>> > > >  t.java:
>> > > > 550)
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
>> > > >  :
>> > > > 530)
>> > > >         at
>> > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
>> > > >  java:
>> > > > 535)
>> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
>> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
>> > > >         at 
>> > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
>> > > > 662)
>> > > >         at com.google.gdata.client.Service.query(Service.java:1204)
>> > > >         at com.google.gdata.client.Service.query(Service.java:1145)
>> > > >         at
>> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
>> > > >  ventsServiceImpl.java:
>> > > > 133)
>> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
>> > > > Source)
>> > > >         at java.lang.reflect.Method.invoke(Unknown Source)
>> > > >         at
>> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
>> > > >  ethod_
>> > > > $1.run(Method_.java:165)
>> > > >         at java.security.AccessController.doPrivileged(Native Method)
>> > > >         at
>> > > > com.google.apphosting.runtime.security.shared.interce

[appengine-java] Re: AuthSub InvalidToken problem

2010-03-31 Thread nicanor.babula
Hmm? No idea? ;)
Thanks in advance.

On Mar 30, 10:06 am, "nicanor.babula" 
wrote:
> That's all the code that deals with google services in my whole
> application. The exception is raised on the following instruction:
> [code]
> CalendarEventFeed resultFeed = calendarService.query(myQuery,
> CalendarEventFeed.class);
> [/code]
>
> What about the environment? You are saying that I might have included
> jars that could interfere with auth sub? Are there any known
> conflictual libraries? I have simply included all the jars shipped
> with the gdata-samples package.
>
> On Mar 30, 4:51 am, seleronm  wrote:
>
> > Hi,
>
> > I was not able to have them reproduce behavior though I tried a
> > little.
> > (It was possible to execute it normally).
>
> > Can post do you the source code further?
> > I want to confirm behavior.
>
> > Or, the environment might be a cause.
>
> > thank.
>
> > > Come on!
> > > Anyone, anything?
>
> > > Thanks.
>
> > > On Mar 26, 12:54 pm, "nicanor.babula" 
> > > wrote:
>
> > > > Hi all,
>
> > > > I am facing a strange problem in with my app in GAE and I can't seem
> > > > to figure it up by myself, so I hope you'll help me.. Here we are:
>
> > > > I do :
>
> > > > [code]
> > > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> > > > "http://www.google.com/calendar/feeds/default/private/full";, false, 
> > > > true);
> > > > response.sendRedirect(authSubUrl);
> > > > [/code]
>
> > > > in my servlet in order to get an auth subtoken. And the servlet at
> > > > nextUrl does:
> > > > [code]
> > > > String oneTimeUseToken =
> > > > AuthSubUtil.getTokenFromReply(request.getQueryString());
> > > > if(oneTimeUseToken != null){
> > > >   String sessionToken =
> > > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
> > > >   // persist the sessiontoken}
>
> > > > // redirect to the page using google services
> > > > [/code]
> > > > in order to retrieve and persist the sessiontokenalong with other
> > > > user information.
>
> > > > The problem is that when later I do:
> > > > [code]
> > > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> > > > private/full");
> > > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
> > > > CalendarService calendarService = new CalendarService("some-app-
> > > > name");
> > > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
> > > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
> > > > CalendarEventFeed.class);
> > > > [/code]
>
> > > > It says that thetokenisinvalid, and raises this exception:
> > > > [code]
> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> > > > null
> > > > com.google.gdata.util.AuthenticationException: OK
> > > > 
> > > > 
> > > > Tokeninvalid-InvalidAuthSubtoken.
> > > > 
> > > > 
> > > > Tokeninvalid-InvalidAuthSubtoken.
> > > > Error 401
> > > > 
> > > > 
>
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
> > > >  Request.java:
> > > > 596)
> > > >         at
> > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
> > > >  DataRequest.java:
> > > > 563)
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
> > > >  t.java:
> > > > 550)
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
> > > >  :
> > > > 530)
> > > >         at
> > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
> > > >  java:
> > > > 535)
> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
> > > >         at 
> > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> > > > 662)
> > > >         at com.google.gdata.client.Service.query(Service.java:1204)
> > > >         at com.google.gdata.client.Service.query(Service.java:1145)
> > > >         at
> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
> > > >  ventsServiceImpl.java:
> > > > 133)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> > > > Source)
> > > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_
> > > > $1.run(Method_.java:165)
> > > >         at java.security.AccessController.doPrivileged(Native Method)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.privilegedInvoke(Method_.java:
> > > > 163)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.invoke_(Method_.java:
> > > > 124)
> > > >         at
> > 

[appengine-java] Re: AuthSub InvalidToken problem

2010-03-30 Thread nicanor.babula
That's all the code that deals with google services in my whole
application. The exception is raised on the following instruction:
[code]
CalendarEventFeed resultFeed = calendarService.query(myQuery,
CalendarEventFeed.class);
[/code]

What about the environment? You are saying that I might have included
jars that could interfere with auth sub? Are there any known
conflictual libraries? I have simply included all the jars shipped
with the gdata-samples package.

On Mar 30, 4:51 am, seleronm  wrote:
> Hi,
>
> I was not able to have them reproduce behavior though I tried a
> little.
> (It was possible to execute it normally).
>
> Can post do you the source code further?
> I want to confirm behavior.
>
> Or, the environment might be a cause.
>
> thank.
>
> > Come on!
> > Anyone, anything?
>
> > Thanks.
>
> > On Mar 26, 12:54 pm, "nicanor.babula" 
> > wrote:
>
> > > Hi all,
>
> > > I am facing a strange problem in with my app in GAE and I can't seem
> > > to figure it up by myself, so I hope you'll help me.. Here we are:
>
> > > I do :
>
> > > [code]
> > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> > > "http://www.google.com/calendar/feeds/default/private/full";, false, true);
> > > response.sendRedirect(authSubUrl);
> > > [/code]
>
> > > in my servlet in order to get an auth subtoken. And the servlet at
> > > nextUrl does:
> > > [code]
> > > String oneTimeUseToken =
> > > AuthSubUtil.getTokenFromReply(request.getQueryString());
> > > if(oneTimeUseToken != null){
> > >   String sessionToken =
> > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
> > >   // persist the sessiontoken}
>
> > > // redirect to the page using google services
> > > [/code]
> > > in order to retrieve and persist the sessiontokenalong with other
> > > user information.
>
> > > The problem is that when later I do:
> > > [code]
> > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> > > private/full");
> > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
> > > CalendarService calendarService = new CalendarService("some-app-
> > > name");
> > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
> > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
> > > CalendarEventFeed.class);
> > > [/code]
>
> > > It says that thetokenisinvalid, and raises this exception:
> > > [code]
> > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> > > null
> > > com.google.gdata.util.AuthenticationException: OK
> > > 
> > > 
> > > Tokeninvalid-InvalidAuthSubtoken.
> > > 
> > > 
> > > Tokeninvalid-InvalidAuthSubtoken.
> > > Error 401
> > > 
> > > 
>
> > >         at
> > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
> > >  Request.java:
> > > 596)
> > >         at
> > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
> > >  DataRequest.java:
> > > 563)
> > >         at
> > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
> > >  t.java:
> > > 550)
> > >         at
> > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
> > >  :
> > > 530)
> > >         at
> > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
> > >  java:
> > > 535)
> > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
> > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
> > >         at 
> > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> > > 662)
> > >         at com.google.gdata.client.Service.query(Service.java:1204)
> > >         at com.google.gdata.client.Service.query(Service.java:1145)
> > >         at
> > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
> > >  ventsServiceImpl.java:
> > > 133)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > >         at
> > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > >  ethod_
> > > $1.run(Method_.java:165)
> > >         at java.security.AccessController.doPrivileged(Native Method)
> > >         at
> > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > >  ethod_.privilegedInvoke(Method_.java:
> > > 163)
> > >         at
> > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > >  ethod_.invoke_(Method_.java:
> > > 124)
> > >         at
> > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > >  ethod_.invoke(Method_.java:
> > > 43)
> > >         at
> > > com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> > > 562)
> > >         at
> > > com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi
> > >  ceServlet.jav

[appengine-java] Re: AuthSub InvalidToken problem

2010-03-29 Thread seleronm
Hi,

I was not able to have them reproduce behavior though I tried a
little.
(It was possible to execute it normally).

Can post do you the source code further?
I want to confirm behavior.

Or, the environment might be a cause.

thank.

> Come on!
> Anyone, anything?
>
> Thanks.
>
> On Mar 26, 12:54 pm, "nicanor.babula" 
> wrote:
>
> > Hi all,
>
> > I am facing a strange problem in with my app in GAE and I can't seem
> > to figure it up by myself, so I hope you'll help me.. Here we are:
>
> > I do :
>
> > [code]
> > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> > "http://www.google.com/calendar/feeds/default/private/full";, false, true);
> > response.sendRedirect(authSubUrl);
> > [/code]
>
> > in my servlet in order to get an auth subtoken. And the servlet at
> > nextUrl does:
> > [code]
> > String oneTimeUseToken =
> > AuthSubUtil.getTokenFromReply(request.getQueryString());
> > if(oneTimeUseToken != null){
> >   String sessionToken =
> > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
> >   // persist the sessiontoken}
>
> > // redirect to the page using google services
> > [/code]
> > in order to retrieve and persist the sessiontokenalong with other
> > user information.
>
> > The problem is that when later I do:
> > [code]
> > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> > private/full");
> > CalendarQuery myQuery = new CalendarQuery(feedUrl);
> > CalendarService calendarService = new CalendarService("some-app-
> > name");
> > calendarService.setAuthSubToken(currentUser.authSubToken, null);
> > CalendarEventFeed resultFeed = calendarService.query(myQuery,
> > CalendarEventFeed.class);
> > [/code]
>
> > It says that thetokenisinvalid, and raises this exception:
> > [code]
> > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> > null
> > com.google.gdata.util.AuthenticationException: OK
> > 
> > 
> > Tokeninvalid-InvalidAuthSubtoken.
> > 
> > 
> > Tokeninvalid-InvalidAuthSubtoken.
> > Error 401
> > 
> > 
>
> >         at
> > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData 
> > Request.java:
> > 596)
> >         at
> > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG 
> > DataRequest.java:
> > 563)
> >         at
> > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques 
> > t.java:
> > 550)
> >         at
> > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java 
> > :
> > 530)
> >         at
> > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest. 
> > java:
> > 535)
> >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
> >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
> >         at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> > 662)
> >         at com.google.gdata.client.Service.query(Service.java:1204)
> >         at com.google.gdata.client.Service.query(Service.java:1145)
> >         at
> > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE 
> > ventsServiceImpl.java:
> > 133)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >         at java.lang.reflect.Method.invoke(Unknown Source)
> >         at
> > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> > ethod_
> > $1.run(Method_.java:165)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at
> > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> > ethod_.privilegedInvoke(Method_.java:
> > 163)
> >         at
> > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> > ethod_.invoke_(Method_.java:
> > 124)
> >         at
> > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> > ethod_.invoke(Method_.java:
> > 43)
> >         at
> > com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> > 562)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi 
> > ceServlet.java:
> > 188)
> >         at
> > cri.domodentweb.server.rpc.BaseServiceImpl.processCall(BaseServiceImpl.java 
> > :
> > 12)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServi 
> > ceServlet.java:
> > 224)
> >         at
> > com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Abstract 
> > RemoteServiceServlet.java:
> > 62)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >         at 
> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > 511)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1166)
> >        

[appengine-java] Re: AuthSub InvalidToken problem

2010-03-29 Thread nicanor.babula
Come on!
Anyone, anything?

Thanks.

On Mar 26, 12:54 pm, "nicanor.babula" 
wrote:
> Hi all,
>
> I am facing a strange problem in with my app in GAE and I can't seem
> to figure it up by myself, so I hope you'll help me.. Here we are:
>
> I do :
>
> [code]
> String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> "http://www.google.com/calendar/feeds/default/private/full";, false, true);
> response.sendRedirect(authSubUrl);
> [/code]
>
> in my servlet in order to get an auth subtoken. And the servlet at
> nextUrl does:
> [code]
> String oneTimeUseToken =
> AuthSubUtil.getTokenFromReply(request.getQueryString());
> if(oneTimeUseToken != null){
>   String sessionToken =
> AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
>   // persist the sessiontoken}
>
> // redirect to the page using google services
> [/code]
> in order to retrieve and persist the sessiontokenalong with other
> user information.
>
> The problem is that when later I do:
> [code]
> URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> private/full");
> CalendarQuery myQuery = new CalendarQuery(feedUrl);
> CalendarService calendarService = new CalendarService("some-app-
> name");
> calendarService.setAuthSubToken(currentUser.authSubToken, null);
> CalendarEventFeed resultFeed = calendarService.query(myQuery,
> CalendarEventFeed.class);
> [/code]
>
> It says that thetokenisinvalid, and raises this exception:
> [code]
> cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> null
> com.google.gdata.util.AuthenticationException: OK
> 
> 
> Tokeninvalid-InvalidAuthSubtoken.
> 
> 
> Tokeninvalid-InvalidAuthSubtoken.
> Error 401
> 
> 
>
>         at
> com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData 
> Request.java:
> 596)
>         at
> com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG 
> DataRequest.java:
> 563)
>         at
> com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques 
> t.java:
> 550)
>         at
> com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java :
> 530)
>         at
> com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest. 
> java:
> 535)
>         at com.google.gdata.client.Service.getFeed(Service.java:1102)
>         at com.google.gdata.client.Service.getFeed(Service.java:1044)
>         at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> 662)
>         at com.google.gdata.client.Service.query(Service.java:1204)
>         at com.google.gdata.client.Service.query(Service.java:1145)
>         at
> cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE 
> ventsServiceImpl.java:
> 133)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> ethod_
> $1.run(Method_.java:165)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> ethod_.privilegedInvoke(Method_.java:
> 163)
>         at
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> ethod_.invoke_(Method_.java:
> 124)
>         at
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M 
> ethod_.invoke(Method_.java:
> 43)
>         at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 562)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi 
> ceServlet.java:
> 188)
>         at
> cri.domodentweb.server.rpc.BaseServiceImpl.processCall(BaseServiceImpl.java :
> 12)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServi 
> ceServlet.java:
> 224)
>         at
> com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Abstract 
> RemoteServiceServlet.java:
> 62)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 511)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1166)
>         at
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo 
> bUploadFilter.java:
> 97)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF 
> ilter.java:
> 35)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doF