Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Azure AD Authentication to Existing ASP.NET MVC Application?

I have an existing ASP.NET MVC application using Visual Studio 2013. I followed this walk-through but it only concerns itself with a new greenfield project while selecting Change Authentication in project template: Developing ASP.NET Apps with Windows Azure Active Directory

I am not interested in using OWIN and OpenID Connect Katana modules as these components have lots of issues so I am waiting for that technology to mature and render out all the current problems.

I aim is understand how to manually add all the components and configuration to my existing ASP.NET MVC application to achieve the same Azure AD authentication model in Rick Anderson's article.

like image 491
puri Avatar asked Dec 20 '14 15:12

puri


People also ask

How do I add Azure AD authentication to existing ASP NET core application?

Select ASP.NET Core Web Application>Choose Web Application (Model-View-Controller) template> Click on the "Change Authentication" button>Select "Work or School Accounts". Choose Cloud - Single Organization. Fill up the field of Domain which is the Azure Active Directory tenant name (say, softdreams.onmicrosoft.com).


2 Answers

The tooling in VS 2013 doesn't support adding this to an existing project. At the bottom of the link you referenced in the More Information section is a deep dive article where I dissect the code and configuration that gets added. So, you could use that as a reference to find the deltas and apply them to your project.

Now, Visual Studio 2015 offers us some hope in this scenario. It's in preview of course, but you may give it a try. In Solution Explorer, right click on your existing project and select the Configure Azure AD Authentication option.

enter image description here

like image 133
Rick Rainey Avatar answered Oct 04 '22 01:10

Rick Rainey


In Visual Studio 2017 the option to enable Authentication with Azure Active Directory is in Connected Services:

enter image description here

enter image description here

like image 23
Matthew Avatar answered Oct 04 '22 01:10

Matthew