Cname records for SAAS customers - asp.net-mvc

I'm working on a SAAS product. It's hosted on Windows Azure.
I need to give our customers to option to have CName records.
Our app URL looks like this: login.appname.com
When a customer is created they get their own address created for them that looks like this: login.appname.com/CustomerCompanyName
What I want to do is have our customers URL's look like : login.CustomerCompanyName.com/
What is the best way to go about this.
It's a webapp building in ASP.NET 4/ MVC4 hosted on Microsoft Azure.
Any tips would be greatly appreciated.
Thanks,
Noel

You need to understand the technical limitation with your requirement.
Your application is running at login.appname.com
Customer is created and you provide specific site as login.appname.com/customercompanyname
Note: At this time customercompanyname.com is not even a registered domain or if it is registered it may belong to someone else. (or do you register the customercompanyname.com domain first and then create the new customer in Azure App?
What you want to do is very complex to achieve. It is not impossible however every time you will do that, you will have to modify your Azure app to handle the host header. I personally believe a very ugly work.
So if you want to know what is needed, here is just what I think (others may be different or better solution):
Register a domain name for your customer (customerAcompanyB.com)
Create a custom folder in your Windows Azure Application during development
Modify your your Azure application to handle customerAcompanyB.com hostheader so you can route the request to appname.com/folder_name
In your customerAcompanyB.com domain registrar setup CNAME to route your appname.com

Related

Design a new cloud based application with multiple login mechanism

I recently switched to a new company where my manager wants me to develop entirely new cloud based project in MVC. I have never worked on a project from the start and I think this is a good opportunity for me to lead.
However, I think the requirements of the clients are bit confusing.
Here is what he wants:
Client should be able to access the cloud hosted application from his network with single sign on. He wants to use his active directory for that.
There are different users in active directory, they will have different roles (I think we can handle this on database side. Create different roles and assign roles to users).
Client has to add vendor info in the application. But for this, system should send an email to vendor with the url of the cloud application. He wants user to login to the application using 2 Factor Authentication. So, send dummy password with url, and send OTP to his mobile number. Just like registering to any system.
Now my questions are:
Is it possible to have 2 different types of login mechanisms in the same application? SSO for client and 2FA for outside vendors?
If yes, could you please guide me in the right direction?
what things I need? Which framework, design pattern should I prefer?
How do I proceed ?

Deploying the same site N times

With our company, we sell a service to our customers,
this is a website which let customers enter some parameters and informations, and then, they can query a web service to get
the previous informations computed. These web sites are hosted on our servers.
We would have on our servers one database per client (dbo.Client1, dbo.Client2...) with the same schema.
And we would like to provide a different url for each client :
expl :
www.client1.service.com www.client1.ws.com/compute
www.client2.service.com www.client2.ws.com/compute
But i'm wondering how to deploy easily the web services and the web site?
Do i have to deploy one web service and one website per client (with different web config)?
And maybe create multiple deployment scripts ?
Or is it possible to imagine one instance of each (web service and web site), listening on several addresses, and creating different
connection string according to the entry point of the request (is it even possible with MVC or WCF ?)
Any other idea ?
I don't know what is the best practice here.
Thank you.
if anybody read that question one day, i solve my problem using multi-tenant solution, which allow me to deploy only one instance of the site.
The site handle the webrequest, and according to the host, connect to different database.

ASP.NET MVC - Creating SAAS framework

I currently have a ASP.NET MVC 2 web application and would like to enhance the architecture to support a SAAS model. I plan on eventually building a number of web applications so would like to design the system accordingly.
The goal would be that when a client would hit the following url clientxyz.domain.com they would see an image of all their subscribed applications. This would essentially be a web page with a bunch of application icons. Once a client would click on a icon it would navigate to that actual web app at the following example url clientxyz.domain.com/application_name.
We currently use GoDaddy to host our domain and plan on using a Cloud based iLand server to host our application. We only plan on a few new clients a year due to the nature of our software.
I have a number of questions:
Is it possible to programmatically create subdomains on the fly using a .Net api. I'm pretty sure GoDaddy does not let you do it. So is there another provider that would let me create subdomains via C#. This may be the wrong approach and may not even need to physically create client subdomains. Instead I may be able to accomplish this using url rewriting in IIS/MVC?? If I use rewriting, it would have to satisfy the url requirements mentioned above. Any suggestions/links/examples?
Should I create a separate IIS website for each tenant/client? Or should I use URL rewriting and simply have a single website / application pool? Looks like you can programmatically spin up IIS websites (example: http://www.eggheadcafe.com/tutorials/csharp/d4bba585-b517-4834-8476-ff05b085d86e/iis--create-app-pools-virtual-directories-and-web-sites-c-net.aspx)
Since we are using a Virtual Server on iLand do I simply have to point GoDaddy to the nameserver at iLand.
I would like to automate the entire new client process if possible. To accomplish this, I would have to created the database (probably going to have single db per tenant), populate the global client/tenant table, create admin user account and subscription details in newly created database and create subdomain depending on approach. Am I missing anything?
thanks in advance.

See public side of Rails Web app as another domain

Let's say I have a appointment scheduling web app and there are some parts of the Web app that are public for everyone to see, such as Staff or a Request an appointment page. But I want these sections to be visible with the clients domain. How should the domain settings to be adjusted?
There's multiple things you could be saying here. If you have an appointment scheduling app with a public and private aspect of the application, you can use access control in Rails. For example, people in a Staff role are going to fill/manage/view appointments but clients/customers can only request appointments. This is pretty easy and doesn't have anything to do with a (DNS) domain (btw, a domain can mean many things so you need to say DNS domain or security domain or problem domain).
You can use an authentication gem (Devise, Authlogic, Sorcery) to identify users of the systems (they login with a password etc). After someone is identified, they can be authorized (or denied) functionality of the site (with a gem like CanCan). Give your staff users a role called staff. Define staff as being able to manage all Appointments but customers only being able to read and create Appointments.
http://asciicasts.com/episodes/192-authorization-with-cancan
If you are trying to split up the site in this way with DNS domains, that's not a good way to go. But, if you really do have all this authorization and authentication worked out and are asking a DNS question, let's think about this.
You are trying to have /public be www.bizcorp.com and the rest of the app be somethingterrible.heroku.com? That's tricky because the rails app bundles /public and you need a way to split the two based on something. You can do this in rails 3 but you'd be splitting in routes.rb for a given REST resource which is really shared between two domains (appointments). So now my appointments controller can't handle all appointments. I have to route based on a domain name match. So you'd either need to figure out if splitting on domain is really the smart thing to do or you'd need to hack together a PublicAppointments controller and a StaffAppointments controller which is breaking DRY.
There's more here on how to do the routes.rb matching for subdomains and top level domains:
http://asciicasts.com/episodes/221-subdomains-in-rails-3
I'd go the authorization route and put the whole site on the customer's domain. Roles handle the public and private functionality and my URLs don't have to change everywhere. I'd only go with the DNS hackery if I was in a crazy virtual hosted environment or some weird networking constraint.
Hope this gives you some ideas.

Rails Subdomain Clustering

I am about to be writing a Ruby on Rails app which will use sub-domains to authenticate users. We will have two types of accounts:
user accounts
domain accounts
Users will thus be able to belong to multiple domain accounts using the same credentials. I hope to have the ability for a domain account administrator to be able to search for particular users and add them to their domain.
In addition to simply creating a domain account in the database, I want to setup an actual account on the machine (linux-based) so that users can drop files into a special directory and we can run some scripts to import that new data. Alternatively, I may write a client/server script to make this process easier.
All of this I believe I can do, however, as soon as the project attains a certain number of domain accounts, it will be necessary to figure out how to cluster the domain accounts appropriately so that we can have multiple machines.
From a database standpoint, this is fairly easy and there are lots of tutorials on how to cluster MySQL or whichever SQL server I decide to use. So my question really pertains more to machine accounts as well as how to cluster a Rails app.
If you want a comparison, think of this project like GitHub or Beanstalk but with data that isn't source control related.
Does anybody have any experience with this or know of any really good articles/books to get me started?
Thanks very much!
I suggest you look at using one of the PAM modules that lets you do account authentication against a SQL database. That way you just add the domain account to the SQL database and you get UNIX accounts (on all your servers) automagically, for free. So the clustering should just happen for free too...

Resources