Ruby on Rails
Wednesday, November 24, 2010
On 23 Nov 2010, at 23:39, Xdmx Xdmx wrote:
Hi, there are a lot of rails application out there that permit the users
to host the application on a subdomain (e.g. http://test.myapp.com) or
over a user external domain (e.g. http://testapp.com).
How this is managed this in the code? I'm googling around but finding
only about subdomains, not external domains.
Much in the same way you handle subdomains, but with the complete domain as a value in your database instead of just the subdomain.
Also, how can the sessions be managed? I mean, a user login on an https
page on myapp.com and then redirected back to testapp.com, will the
session be kept? Otherwise, how can this be solved?
This is more complicated. You need to do it in a similar way as omniAuth does for Twitter/Facebook/OpenID/… logins.
I'd like to manage all this automatically, without having to set a vhost
for every application/domain and all the links on testapp.com should be
referring to testapp.com, not myapp.com
You should automate it then. You will basically write to the Apache vhost conf files (and possibly the dns server configs) and reload the configuration from your Rails app. The main concern here should be handling the security on the system level. As long as the user then goes to the full domain, all links will stay within that domain.
Best regards
Peter De Berdt
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment