On Wed, Feb 25, 2009 at 10:51 AM, sthakkar <[email protected]> wrote:
>
> Hi guys,
>
> Quick question:
>
> I am using the auth sub auth method to access gcalendar api data, but
> get a token upgrade error message when I try to refresh my page. Is
> the solution as simple as storing the old token in a cookie or is the
> problem my page refresh re-requesting the token? I am currently
> testing using a modified Calendar.php demo file from the Xend files.
>
> Error message:
> Fatal error: Uncaught exception 'Zend_Gdata_App_AuthException' with
> message 'Token upgrade failed. Reason: <HTML> <HEAD> <TITLE>Invalid
> AuthSub token.</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Invalid AuthSub token.</H1> <H2>Error 403</H2> </BODY> </HTML> '
> in C:\xampp\php\PEAR\library\Zend\Gdata\AuthSub.php:141 Stack trace:
> #0 C:\xampp\htdocs\mashup\Calendar.php(187):
> Zend_Gdata_AuthSub::getAuthSubSessionToken('CLjT-_h1EO_Rk_M...', Object
> (Zend_Gdata_HttpClient)) #1 C:\xampp\htdocs\mashup\Calendar.php(206):
> getAuthSubHttpClient() #2 C:\xampp\htdocs\mashup\Calendar.php(972):
> processPageLoad() #3 {main} thrown in C:\xampp\php\PEAR\library\Zend
> \Gdata\AuthSub.php on line 141
>
> Thanks/

This question should be posted to the Accounts API group:

    http://groups.google.com/group/Google-Accounts-API

But to answer your question, there are two types of AuthSub tokens:
single-use tokens and session tokens. When a user is redirected from
the Google Accounts sign-in system to your application, a single-use
token is passed as part of the URL. Your application then makes a call
back to our servers to convert that token into a session token (via
AuthSubSessionToken).

If you reload the page, the single-use token will still be in the URL.
I'm assuming you're trying to reuse that, and again upgrade it to a
session token. However, as the name suggests, single-use tokens can
only be used once. This is why you're getting that error.

The answer is, as you suspected, to store the session token in a PHP
session so that you don't need to make another call to
AuthSubSessionToken.

-- 
Trevor Johns

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data Protocol" 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/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to