Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password Protecting an Azure Website not just via Web App Form

Tags:

azure

I have a beta web application which I want to password protect. I would like to lock down the whole folder as one does in IIS which then force the username/password popup. I have done this with my previous shared host on IIS7. However now that I have migrated the site to Azure Websites, I cannot find a method to do this in Azure.

All feedback, that I have read, on this seem to say that it is forms authentication only. Is this true, or is there a way to password protect a complete Azure Website?

Thanks,

EDIT:

I do authenticate within the web app, since this is a requirement of the web app, but I want a simple password protection over all of this that was external to the application.

like image 517
SamJolly Avatar asked Mar 19 '14 03:03

SamJolly


2 Answers

Use HttpAuthModule nuget.

You can install Nuget package with Visual Studio. Right click on the project for the website you want to secure. Click "Manage NuGet packages". In the browse tab in the search box, search for the phrase "HttpAuthModule". Select the resulting module and click install. This should install the package and make some changes to your web.config file.

Open the web.config and then edit the settings, in particular change the "value" for the "credentials" parameter to be a "username:password;" of your choosing. Now run your site and you should be prompted to enter a username and password.

like image 60
SamJolly Avatar answered Sep 29 '22 09:09

SamJolly


Another option which is now available is to use the new Azure Websites Authentication / Authorization feature. This enables you to quickly and easily add Azure Active Directory login to your entire website without any code changes. It also works with site slots, so you can have a beta version of your site in a staging slot which is protected by a login page, and a production version which is exposed publicly.

Blog Post: http://azure.microsoft.com/blog/2014/11/13/azure-websites-authentication-authorization/

Demo Video: http://azure.microsoft.com/en-us/documentation/videos/azure-websites-easy-authentication-and-authorization-with-chris-gillum/

like image 36
Chris Gillum Avatar answered Sep 29 '22 08:09

Chris Gillum