7

Has there ever been a more confusing/difficult time to be a web developer using the Microsoft stack? That's not really my question... I know that the answer is a categorical no. :)

The single page app template that comes with VS 2013 is deplorable.

I've been working on building up a similar project template that uses Angular JS on the client, but I'm starting to spin my wheels a bit porting over the external (openId/oauth) login features.

I believe this is because of the lack of good, single-point-of-truth, and current documentation for Katana's auth/security bits and also because of how unreadable the client side code is in the S.P.A. template in visual studio 2013.

I know that I can get through it, but while I'm struggling with it, I'm wondering:

Are there any good community provided project templates or example code bases in existence that use .NET 4.5 (MVC5/Web Api 2), Angular JS, the new ASP.NET Identity stuff, and the Katana packages?

There's HotTowel.Angular, but it takes no stance on security. Besides, it's a Nuget package, which can't or shouldn't dictate as much as a proper project template can.

Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
  • HotTowel.Angular is a sample/template. It's common for such samples to be distributed as NuGet packages because (1) you don't have to modify VS just to see a sample and (2) it's easier to update. The premise behind using NuGet is you start with an empty ASP.NET project and throw the NuGet package on top of it. Not super elegant, but works well in practice. – Edward Brey May 22 '14 at 00:43

1 Answers1

7

I agree with your observations. I have found the following setup that seems to meet your requirements and I think works very well (I don't have a template), I would suggest the following:

  1. Create an empty WebApi2 project and adopt authentication/authorization depicted here
  2. Use a regular index.html in the base directory as a launching point for your angular application. You can either maintain your client packages with nuget, npm, or bower.
  3. Use whatever technique you like for organization of client code.

Personally, I would create 3 projects, One for client code, (mydomain.com) One for your api (api.mydomain.com) and one for your Model/Repository/Data Access layer.

update Here is an open-source project that might be what you're looking for!

calebboyd
  • 5,744
  • 2
  • 22
  • 32
  • Thanks. You've described what I have right now, almost perfectly. What I'm looking for is a good example of how to integrate the external login features of Katana with an Angular based single page app. – Ronnie Overby Mar 01 '14 at 21:58
  • There is also this nice [post](http://www.codeproject.com/Articles/742532/Using-Web-API-Individual-User-Account-plus-CORS-En) – calebboyd Mar 13 '14 at 19:00