Also, would like to get some opinions on how to manage the
authentication once it's set up. Here's how I see it working:
- User navigates to www.mysite.com/customerName
- System retrieves company data and stores in session and displays
login page
- User logs in. System authenticates user
- For all RPC calls, system verifies user is logged in *and* checks
that the URL matches the company info in the session
Basically, I want to guard against a user logging into one client
site, then navigating to another.
Thanks
Kyle
On Mar 22, 10:41 am, Kyle Baley <kyle.ba...@gmail.com> wrote:
> I'm new to GWT and the Java world having been in the .NET space for
> about 10 years. Our application will be a multi-tenant one (at least,
> to the degree that I understand the definition). We'd like customers
> to be able to navigate towww.mysite.com/customerName, then log in
For example, Acme Hair Salon would navigate to mysite.com/
acmeHairSalon/myapp.html and Generic Dog Collars would navigate to
mysite.com/genericDogCollars/myapp.html. Both URLs should map to the
same instance of the application but in it, I'd check the URL to see
which company was being used and filter all the data in it
accordingly. I know how to do the filtering and can probably figure
out how to check the URL for a company token. But I don't know how to
configure GWT and/or GAE to use a single instance of the application
for multiple (generic) URLs that aren't pre-defined. It sounds to me
like something that should be done in web.xml but again, I don't know
how.
While you *may* be able to do that, the general GWT way would be to
have your urls look more like this:
mysite.com/myapp.html#/acmeHairSalon
mysite.com/myapp.html#/genericDogCollars
And you can easily access the tokens via the History class (the
getToken method).
HTH,
Chad
We're doing it this way when we have different versions of client
application, which tends to change more often than server one. Also
works when you have a development version of client that you need to
test with the same server backend.
Regards,
Uros
In any case, I found something that works. I created a JSP page and
dumped the contents of the MyApp.html into it. Then added the
following to my web.xml:
<servlet>
<servlet-name>test</servlet-name>
<jsp-file>/MyApp.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/myApp/clients/*</url-pattern>
</servlet-mapping>
I added /clients in there for now because we're using gwt-dispatch and
I haven't overridden its default of submitting things to /myApp/
dispatch.
Still some kinks to work out (like resource references) but early
results are encouraging.
The problem is, true multi-tenancy isn't supported by GAE...they've
been talking about it for almost 2 years now, but it doesn't seem to
be a priority for them. They want you to use a different domain for
every tenant, which means multiple app instances (multiple versions of
your app to deploy & maintain). It also means your customer/tenant has
to be in the loop for all domain administration tasks, which to me
kind of defeats the purpose of customer-focused cloud computing.
I set my multi-tenant app up on Amazon EC2, using 1 tomcat server and
6 mysql databases (6 tenants...each tenant has on average 10 users).
The beauty is if I need to scale or load balance the app, add more
tenants/database instances or just backup one tenant's data, this is
pretty much just a mouse-click or 6 in the EC2 developer console.
Murray
In any case, I found something that works. I created a JSP page and
dumped the contents of the MyApp.html into it. Then added the
following to my web.xml:
<servlet>
<servlet-name>test</servlet-name><jsp-file>/MyApp.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/myApp/clients/*</url-pattern>
</servlet-mapping>
I added /clients in there for now because we're using gwt-dispatch and
I haven't overridden its default of submitting things to /myApp/
dispatch.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.