Hi Brett, The AuthSub process generally involves: 1) User visits your web application 2) You check if the user has an authsub session token in your location application (session variable, in database, etc) 3) If the user doesn't have an authsub session token, you present the user with some text that asks them to go to the Google website to authenticate. The link that you would direct them to is generated via the AuthSubUtil.getRequestUri method. 4) The user visits the link and, after authenticating, will get redirected back to your application's 'next' URL (defined as the first param to the AuthSubUtil.getRequestUri method). Appended to your next URL will be a query parameter called 'token' This is your one-time-use AuthSub token. 5) Exchange the token received in step #4 for a session token using AuthSubUtil.exchangeForSessionToken method. 6) Store the session token in a session, db, or other persistence mechanism. 7) Use the AuthSub session token for accessing the appropriate Google GData-enabled service.
The text you referenced is referring to part #3. You just need to create a normal HTML link (a href) to the URL generated by the AuthSubUtil.getRequestUri method and direct the user to authenticate. Are you creating a web application or desktop application? For a web application using a servlet controller, I would normally set an attribute on the request object, and then use the RequestDispatcher to forward the request onto a JSP. The JSp can then access the request attribute. I'm less familiar with Java desktop application development, but I would think your GUI toolkit (Swing?) has a way of generating a hyperlink which will interact with the JVM to send the user to the default web browser. However, you wouldn't likely have a 'next' URL to send the user to. This is one of the reasons that ClientLogin authentication is considered acceptable for desktop applications. Cheers, -Ryan On 2/19/07, brettmoreton2111 <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm trying to get the AuthSub to work, but i am confusing myself. I > can't understand how to follow this step: quote from > http://code.google.com/apis/gdata/authsub.html. .. > > "After constructing the "next" URL, your application can use it in a > variety of ways to send the user to the AuthSubRequest handler. The > most common approach is to display a page that tells the user that > they need to follow a link to authorize your application to access > your Google account; then attach the request URL to the link. " > > i'm not sure how to display this in a webpage, how do you link java > variables with a web page? i'm using eclipse btw. > > Thanks > > Brett > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Calendar Data API" 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-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
