Question

I'm building an MVC4 application that is starting to take shape and I want to deploy it privately for staging and preview purposes. I would like only a select few people to be able to access the full application. Most of the application is public, but there is a private area as well that requires the user to login.

I'm looking for the most unintrusive way to privately deploy this application to staging/preview. By unintrusive I mean that I don't want to toggle more than a few lines of code, preferably just a flag in the web.config, to deploy it normally vs privately.

I also want this authorization to overlap the site's existing authorization functionality. In other words, when the person goes to the preview URL I give them, they are brought to a landing page where they must log in using the username/password I also gave them. Once they login, they should be brought to what will be the actual landing page if the application was in production. However, they should NOT be logged in to the application itself (this is what I mean by overlap). This way, they can use the application as normal (registering, then logging in a second time to get to the application's private areas.)

I'd like to have something along the lines of this in my web.config:

<StagingAccess deployPrivately ="true">
    <StagingUsers>
        <StagingUser>
            <UserName>JoeShmoe</UserName>
            <Password>Staging123</Password>
        </StagingUser>
    </StagingUsers>    
</StagingAccess>   

Such that I can simply toggle deployPrivately, add a StagingUser node for a select user, then deploy to my host using Web Deploy.

Some steps would be perfect as I've never actually deployed an MVC app before, let alone like this. But I really need to start being able to show the application to people without exposing any of my code and without a remote desktop to my machine, which makes the app seems laggy.

Was it helpful?

Solution

How about a combination of Authorization Rules: http://weblogs.asp.net/gurusarkar/archive/2008/09/29/setting-authorization-rules-for-a-particular-page-or-folder-in-web-config.aspx and Web.Config Transformations? http://msdn.microsoft.com/en-us/library/dd465326.aspx

Then you would Publish the application using VS with a specific configuration chosen - I believe this could help you accomplish your goals.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top