Why this project?

Why this project?

Because I couldn't find any proper way of working with this technology stack and this kind of authentication ... so I tried to write it myself.

Collaborate

Collaborate

If you find bugs or want to improve the sample project template, feel free to contact me, create a pull request, or whatever you want.

Project

Visit the project site ...

... on Github and check the code if you want.

This site simulates a community-managed article repository. People with accounts can write articles in their dashboards and make them public on the web.

The main objective of this sample application is to provide a way to authenticate and authorize users similar to the default ASP MVC 4 Internet template. You will find Forms and oAuth authentication built-in with the main social providers among another useful features.

I decided to leverage the first template I created to build a more complete application in order to show what Breeze JS can do for you and how to protect saving changes on server.


The first thing you should do is create a new account using the membership system or the oAuth providers.

After registration, a User role will be assigned to you that will permit access to the user dashboard. Once there, you can start writing articles.

While writing on your dashboard, remember to set the article as a public article if you want to make it visible for the rest of the community.

Administrator users can access the admin panel view. If you want to access this view, you'll need to have the Administrator role.

Try to log in with the following: admin/admin1234 and once there, you will be able to check a list with the registered users on this site.


Remember !!

The authorization system in the client can always be hacked! Always authenticate and authorize the request in the server when retrieving the necessary data for your views.

The template is ready to be SEO crawlable. DurandalAuth implements the google ajax crawling scheme for pages without hash fragments. You need the default pushstate option enabled.

I created a interface (Helpers/ISnapshot.cs) that needs to be implemented in order to work.

The default implementation uses a new project I created called AzureCrawler.

This new project is a Worker Role ready to be deployed to Windows Azure and serving a REST Web API via OWIN. The Web API executes a phantomjs process when receiving requests and returns html snapshots. Moreover, AzureCrawler can save the snapshot to Azure Storage and keep it there with the expiration date you choose, so next time the page is requested for any bot, the stored snapshot will be served.

I created AzureCrawler like a separate project but it´s easy to bring all the concepts from AzureCrawler to your own project if you want to keep it in the same solution. Another option is creating your own implementation of ISnapshot.cs