SilverHoodCorp / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
Apache License 2.0
0 stars 0 forks source link

Invalid token error #303

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi 
I'm trying to create prototype of java web app that connects to google docs 
service and display list of user's documents.
I'm using AuthSub to authenticate my application. 

*What steps will reproduce the problem?*
1.Made request for one-time token
https://www.google.com/accounts/AuthSubRequest
?next=http://host-92-124-186-99.pppoe.omsknet.ru:8080/gdocapp/list
&hd=default
&scope=http://docs.google.com/feeds/
&session=1

2.got one-time token
1/jl9na3GU8YCUk0pHRghr_WZBcTnq1EXPztEWGuExbcg

3.got info about session token
{Target=host-92-124-186-99.pppoe.omsknet.ru, Secure=false, 
Scope=http://docs.google.com/feeds/}
1/OIAjtsDaERXRnXsXgBU8rfSY4Y8IDSR8NsrjD7axwFg
4. Create DocsService object and call setUserToken method

*What is the expected output? What do you see instead?*
received error:
com.google.gdata.util.AuthenticationException: Token invalid
while trying to run:
URL feedUri = new URL("http://docs.google.com/feeds/default/private/full");
DocumentListFeed feed = client.getFeed(feedUri, DocumentListFeed.class);
*expected result:*
client.getFeed should execute without error and return doc list.
(Same as I see when use client.setUserCredentials method )

*What version of the product are you using? On what operating system?*
I'm using
Windows XP
Tomcat 6.0.18
Eclipse 3.5
Java 6
gdata.java-1.41.5

Please provide any additional information below.
I've attached servlet source to this issue

Thanks in advance

Original issue reported on code.google.com by levchenk...@gmail.com on 22 Aug 2010 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 9 Sep 2010 at 6:39

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 9 Sep 2010 at 6:39

GoogleCodeExporter commented 9 years ago
Hi after some thinking on code I realize that there was my fault. I used wrong 
method here. So I think You can close this issue.

Original comment by levchenk...@gmail.com on 10 Sep 2010 at 2:43

GoogleCodeExporter commented 9 years ago
If you want, feel free to share here any general information about what you did 
to correct the problem.

Original comment by yan...@google.com on 10 Sep 2010 at 11:11

GoogleCodeExporter commented 9 years ago
I was making the same mistake. Use the setAuthSubToken instead of setUserToken:

docsService.setAuthSubToken(<TOKEN>)

Regards

Original comment by m...@nimbustecnologia.com.br on 21 Aug 2012 at 6:06