The requested URL was not allowed

375 views
Skip to first unread message

waf

unread,
Jun 20, 2009, 5:46:44 PM6/20/09
to Google Web Toolkit
Hi All !

I try to follow GWT Getting Started Tutorial and everthing was fine
until the
3. Personalize the application with the User Service from
GWT and Google App Engine part.

Trying to use User Service on AppEngine deployed app I get

32.82.27.183 - - [20/Jun/2009:14:09:07 -0700] "POST /stockwatcher/
login HTTP/1.1" 500 113 "http://MYAPPID.appspot.com/stockwatcher/
F2BA1EC2336108C70EFD27BB520BF7D5.cache.html" "Mozilla/5.0 (Windows; U;
Windows NT 5.1; pl; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip
(gfe)" "MYAPPID.appspot.com"

javax.servlet.ServletContext log: Exception while dispatching incoming
RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract pl.waf.stockwatcher.client.LoginInfo
pl.waf.stockwatcher.client.LoginService.login(java.lang.String)' threw
an unexpected exception: java.lang.IllegalArgumentException: The
requested URL was not allowed: http://MYAPPID.appspot.com/
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

I have:

1. Login Service interface

package pl.waf.stockwatcher.client;

import com.google.gwt.user.client.rpc.RemoteService;

public interface LoginService extends RemoteService
{
public LoginInfo login(String requestUri);
}

2. LoginService implementation

package pl.waf.stockwatcher.server;

import pl.waf.stockwatcher.client.LoginInfo;
import pl.waf.stockwatcher.client.LoginService;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class LoginServiceImpl extends RemoteServiceServlet implements
LoginService {

@Override
public LoginInfo login(String requestUri)
{
UserService userService= UserServiceFactory.getUserService();
User user= userService.getCurrentUser();
LoginInfo loginInfo= new LoginInfo();

if(user!=null)
{
loginInfo.setLoggedIn(true);
loginInfo.setEmailAddress(user.getEmail());
loginInfo.setNickname(user.getNickname());
loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri));
}
else
{
loginInfo.setLoggedIn(false);
loginInfo.setLoginUrl(userService.createLoginURL(requestUri));
}
return loginInfo;
}
}

3. and login service call

LoginServiceAsync loginService= GWT.create(LoginService.class);
loginService.login(GWT.getHostPageBaseURL(), new
AsyncCallback<LoginInfo>() {

@Override
public void onFailure(Throwable caught) {
handleError(caught);
}

@Override
public void onSuccess(LoginInfo result) {
loginInfo= result;
if(loginInfo.isLoggedIn())
loadStockWatcher();
else
loadLogin();
}
});

Why is userService.createLoginURL(requestUri) failing with requested
URL not allowed?
Are there any restrictions on request URI?
Everything is working fine in the development environment.

--
Wlodek

waf

unread,
Jun 22, 2009, 5:12:37 PM6/22/09
to Google Web Toolkit
That's cleared.
AppEngine application I was deploying the app
was configured with Authentication Options
restricted to the Google Apps domain and I tried
to use it on appspot.com. When used on the
designated domain it works fine.
--
waf

Drew Spencer

unread,
Nov 30, 2011, 12:57:30 PM11/30/11
to google-we...@googlegroups.com, Google Web Toolkit
Just been having this problem, I think.

I have an app at http://usavtestapp1.appspot.com/ and I only want my app available for my Google Apps users.

We already have our main website at our domain: http://utilitiessavings.co.uk - Can I host it on a subdomain or a subfolder of that domain? Am I getting this totally wrong? Does the app need its own domain, a different one to the Google Apps one?

Regards,

Drew
Reply all
Reply to author
Forward
0 new messages