What I do is use userService.createLoginURL("/replaceMeInJs"), then in my
javascript, I replace /replaceMeInJs it when ever I need it and also have to
change the return trip method. I have to make sure its encoded properly too.
This is what I do in my GWT app when I need it. This is probably overkill
for me.
private String getGoogleLoginUrl() {
if (cp.getAccessToken() == null &&
cp.getAccessToken().getThirdPartyLoginData() == null) {
return null;
}
String domain = GWT.getHostPageBaseURL();
String path = Window.Location.getPath();
String qs = Window.Location.getQueryString();
String historyToken = History.getToken();
if (qs == null) {
qs = "";
}
if (domain.matches(".*/") == true) {
domain = domain.substring(0,domain.length()-1);
}
String url = domain + path + qs + "#" + historyToken;
url = URL.encode(url);
url = Global_String.encodeUrlDelimiters(url);
String baseUrl =
cp.getAccessToken().getThirdPartyLoginData().getGoogleLoginUrl();
baseUrl = baseUrl.replaceAll("=%2F.*", "=" + url); // this is where I do it
at.
return baseUrl;
}
Brandon Donnelson
http://gwt-examples.googelcode.com
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-appengine-java?hl=en.