在我的项目的JSON中,url uri是正确的 - > http://FracasoTotal.appsot.com/YoutubeLIST/oauthWindow.html
但是当我点击部署appengine,然后点击登录按钮,选择我的帐户并发送此错误:
在Google的控制台中,名称,credencials等都是正确的,我不明白哪个是问题。
public class YoutubeListView extends Composite{
private static final Auth AUTH = Auth.get();
private VerticalPanel mainPanel;
private final Label labelAccessToken = new Label("");
public YoutubeListView(Map<String, Object> params) {
mainPanel = new VerticalPanel();
initWidget(mainPanel);
final String YOUTUBEAUTH_URL = "https://accounts.google.com/o/oauth2/auth";
final String YOUTUBECLIENT_ID = "176930466315-6jamfetq1pm40igg3rmjp49tcmt7mtp7.apps.googleusercontent.com";
final String YOUTUBE_SCOPE = "https://www.googleapis.com/auth/youtube";
Button buttonYT= new Button("Loguea tu cuenta de Youtube");
final Label labelYT = new Label("");
buttonYT.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final AuthRequest req = new AuthRequest(YOUTUBEAUTH_URL,YOUTUBECLIENT_ID).withScopes(YOUTUBE_SCOPE);
AUTH.login(req, new Callback<String, Throwable>() {
public void onFailure(Throwable caught) {
Window.alert("No se puede autentificar " + caught.getMessage());
}
public void onSuccess(String token) {
labelAccessToken.setText(token);
}
});
}
});
mainPanel.add(buttonYT);
mainPanel.add(labelAccessToken);
mainPanel.add(labelYT);
}
}