Yes, the nextUrl must be the address of the page in which you would like to
send the user after authorization.

Your efecLogin method does not do anything that would cause GWT to redirect
the user to actually authorize a token.

This is described after the code sample here:
http://code.google.com/apis/gdata/docs/auth/authsub.html#request-one-time-token

"""
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 their Google account; then
attach the request URL to the link. For example, you could output the
following string in your web app:
"""

In short, either show that link to your user, or redirect them to it so that
they can authorize a token.

-Vic



On Wed, Mar 9, 2011 at 10:42 AM, christophe peixoto <
[email protected]> wrote:

> package com.spreadshettWA.client;
>
> import com.spreadshettWA.shared.FieldVerifier;
>
> import com.google.gdata.client.http.AuthSubUtil;
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.event.dom.client.KeyCodes;
> import com.google.gwt.event.dom.client.KeyUpEvent;
> import com.google.gwt.event.dom.client.KeyUpHandler;
> import com.google.gwt.user.client.rpc.AsyncCallback;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.DialogBox;
> import com.google.gwt.user.client.ui.HTML;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.TextBox;
> import com.google.gwt.user.client.ui.VerticalPanel;
> import com.google.gdata.client.*;
>
>
> /**
>  * Entry point classes define <code>onModuleLoad()</code>.
>  */
> public class Test_spreadsheetWA implements EntryPoint {
>   private VerticalPanel mainPanel = new VerticalPanel();
>   private Button LoginButton = new Button("Login");
>   private Label msg = new Label();
>
>   /**
>    * Entry point method.
>    */
>   public void onModuleLoad() {
>     // TODO Create table for stock data.
>     // TODO Assemble Add Stock panel.
>  mainPanel.add(msg);
>  mainPanel.add(LoginButton);
>  RootPanel.get("stockList").add(mainPanel);
>  msg.setText("A minha Aplicacao necessita de Aceder a sua conta Google
> Docs.Por Favor efectue o Login de maneira a permitir o acesso");
>
>  // Listen for mouse events on the Add button.
>     LoginButton.addClickHandler(new ClickHandler() {
>       public void onClick(ClickEvent event) {
>         efecLogin();
>
>       }
>     });
>
>
>   }
>
>  //due Login
>   private void efecLogin() {
>     // Tentativa de login
>  String nextUrl = "
> http://127.0.0.1:8888/Test_spreadsheetWA.html?gwt.codesvr=127.0.0.1:9997";;
>   String scope = "https://spreadsheets.google.com/feeds";;
>   boolean secure = false;
>   boolean session = true;
>   String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, scope, secure,
> session);
>
>   }
>
>
> This code doesnt work and i dont understand why.
> First i do not know what i must write in nextUrl,should i write the local
> adress of my page?
> And beside that,the efecLogin function do not work..i dont understand
> why..how can i work with the Authsub in GWT?
>

Reply via email to