If you have any question about this article or Vorlon.js, feel free to contact me on twitter: http://twitter.com/meulta

When we started Vorlon.js with Pierre, David and David we wanted to keep it as simple as possible. It is our main concern, our mojo. That is why you only have to run npm install –g vorlon to get a Vorlon server and that you only have to add ONE line of code in your client to connect it to the Vorlon dashboard. This is why in the early version we did not implement any kind of authentication.

In this article I will explain to you why we added this and how to activate it.

If you never used Vorlon.js, read this first : http://blogs.msdn.com/b/eternalcoding/archive/2015/04/30/why-we-made-vorlon-js-and-how-to-use-it-to-debug-your-javascript-remotely.aspx

Why we implemented authentication

image

When we did our first demos in public we published our own Vorlon server instance in a Microsoft Azure website. At this time we didn’t have a way to specify a login and password for the dashboard.

This once led to a huge fail 🙂

Someone in the public copied the url displayed on my screen and accessed the dashboard from his computer. This messed up with the one displayed on my computer and totally screwed our demo. YEY ! o/

From this fail we made the decision to implement a simple authentication. This is obviously helping us for our demos but also you in the case you want to publish a publicly accessible version of the dashboard.

How to deploy Vorlon.js online easily ?

Vorlon is really easy to install. All you need to to is having Node.js Package Manager (npm) on you box and run the correct command line. Everything is get to you from the npm platform and you can start you instance typing vorlon in your command line.

From there you need to make your server accessible through the internet and open the correct tcp port etc. etc. This can be a bit complicated and if you do not want to manage that yourself you can use a feature we added for you in our github repository : https://github.com/microsoftdx/vorlonjs.

If you go on the bottom of the repo, in the readme section,  you get access to a Deploy to Azure button.

image

By clicking on this, we automatically get you through a 3 steps process which will:

  • Create an Azure website on your Azure subscription (*)
  • Deploy the latest version of Vorlon on it

 

(*) if you do not have an azure subscription and want to get one you can know more in the last section of this article (with FREE options in it ;-))

All of this is automated. You can see a quick video of this here :

How to activate authentication

PLEASE NOTE: For now the authentication is only available in the development-0.0.16 branch on the GitHub repo. To get it, you need to deploy the code from this branch (manually somewhere you want or using Azure deploy). It will be available on the npm package in the 0.0.16 version we should release by the end of september.

We implemented authentication using passport.js. We chose to activated a simple mode which you specify a login and password. For now you can only specify one account and we may implemented a more sophisticated version of this later (including Twitter and Facebook auth and multiple accounts management).

You can activate a basic authentication on the Vorlon.js dashboard by adding 3 values to the config.json file:

image

This file is located in the /server folder on your Vorlon.js deployment folder (or in the node_modules folder if you deployed using npm).

Restart your Vorlon instance and BAM you are now prompted and asked to give your username and password.

vorlonauth

Easy right? 🙂

How to change the config.json file when deployed on Azure

If you chose to deploy Vorlon on an Azure subscription you can access the files hosted on the Azure Web App using Visual Studio Online Monaco. This is a free tool actionable from the Configure section of your web app in the Azure Dashboard.

image

You can then get access to the Edit in Visual Studio Online button on your web app dashboard page.

image

Navigate to the config.json file and edit it to activate authentication (or add / remove plugins also !):

image

Note : do not forget to restart the service for this to be taken into account.

I want to use an Azure Web App but do not have an account yet, what are my options ?

You can create an account on the http://azure.microsoft.com website. This will get you the ability to create free azure web apps. 🙂

Another way to test it is to get a trial by going here : https://azure.microsoft.com/en-us/pricing/free-trial/. You will have a credit card-free account to try azure for one month.

Finally, if you are a Startup or anything else which matches with the requirements you can create a Bizspark account: https://www.microsoft.com/bizspark this will enable you pretty much the same thing as the trial but going on for 3 years.

And if you really want to host Vorlon elsewhere there are no problems, it will work the same way 🙂

If you have any question about this article or Vorlon.js, feel free to contact me on twitter: http://twitter.com/meulta