Connecting a mvc 5 application to ACS in Azure?
Asked Answered
T

4

6

Does anyone know how to connect an MVC 5 application in Visual Studio 2013 to an Azure Access Control Service(ACS)? In Visual Studio 2012 it's possible to do this in Identity and Access Tool, but there is no such in Visual Studio 2013.

Thank you in advance for any help you can provide,

/Steve

Trochlear answered 5/11, 2013 at 8:36 Comment(0)
D
4

Unfortunately, there's no way that I know of to add authentication to a VS2013 project after you've created it, but you can add it on project creation.

Create an ASP.NET project and then click "Change Authentication" when it prompts you to select a template.

You then want to choose "Organizational Accounts" and choose "On-Premises" from the drop-down menu. I know ACS isn't what you were normally think of as "on-premises" but that's what you want. Then enter your metadata document URL. You can leave the other spot blank or fill it in if you want. The metadata document URL is the FederationMetadata.xml file found in the ACS management portal under "Application integration."

Once you set that up, you may need to adjust your Web.config audience URLs to make everything match what you have in the Azure ACS.

Dropsy answered 3/1, 2014 at 16:50 Comment(1)
Thanks Jeff. OnPremise would never come to mind. I spent a lot of time on the first option.Morbid
K
3

Encountered the same problem. Was always returned back to "Configure Authentication". So I tried creating a new user in Azure Active Directory and made it a global administrator with the type New user in your organization. I tried the new user account and it worked. Hope this helps you also.

Kusin answered 16/11, 2013 at 3:6 Comment(0)
V
1

You can create the project in VS2013 as desired. Then open it in VS 2012 where you have access to the "Identity and Access Tool" extension (if you installed it). I tried this with VS2013 Asp.Net Web Application Template. You need to select "Enable web farm ready cookies" to make this work with Azure ACS. It would be better if this wizard worked in 2013 - but it does work this way.

I also found this post for doing it right in 2013 http://gauravmantri.com/2014/03/19/using-windows-azure-access-control-service-in-mvc-5-application-using-visual-studio-2013/. However the 2012 wizard is definitely easier.

Voight answered 6/6, 2014 at 22:43 Comment(0)
P
0

Not sure if this could help but you may have a look at this:

Developing ASP.NET Apps with Windows Azure Active Directory

Pawsner answered 5/11, 2013 at 15:59 Comment(1)
Sorry for not specifing that it was for an existing mvc 5 project, but I also tried to create a new MVC project and connect it through "Configure Authentication", but it didn't work. Because eventhough I typed in my admin usercredentials and clicked "Ok" I was just returned back to "Configure Authentication"(my usercred was correct). So I wasn't able to progress using this wizard. But thank you for your tips. /SteveTrochlear

© 2022 - 2024 — McMap. All rights reserved.