This Node.js app was created to facilitate the authorization of users registered on an Azure Active Directory with Meraki wireless infrastructures. Instead of using a RADIUS server for the authentication, you can spin up a web server that will be serving as your Captive Portal, which will then authenticate the user using OAuth
This application and the step by step below were created / cloned based on the code provided by Microsoft, hosted here. Additionally, the information available at Meraki's documentation about building your own JavaScript captive portal. For the sake of simplicity, I removed any MongoDB action, but if you want to store user information somewhere, the original service provided by Azure gives you that flexibility.
In order to work with Meraki's captive portal, your server will need to run on a publicly available IP, i.e., you will need to host it out in the Internet. There are several alternatives to address this. For development purposes, I recommend using ngrok, which will create introspectable tunnels to your localhost. For production environments, I'd use Heroku, which is a PAAS that has a free tier of service. For the Heroku option, I'm including the required configuration file (ProcFile).
If you're using ngrok, run this command:
$ ngrok http 3000
Once you have the public URL where the server will run, take note of that. I'll refer to it as http://public-url.example.com
on this document.
The steps below were copied from Meraki's official documentation Configuring a Custom-Hosted Splash Page
http://public-url.example.com/login
As seen on https://github.com/AzureADQuickStarts/WebApp-OpenIDConnect-NodeJS
To use this sample you will need a Windows Azure Active Directory Tenant. If you're not sure what a tenant is or how you would get one, read What is an Azure AD tenant? or Sign up for Azure as an organization. These docs should get you started on your way to using Windows Azure AD.
To successfully use this sample, you need a working installation of Node.js.
Next, clone the sample repo and install the NPM.
From your shell or command line:
$ clone this git https://github.com/rafael-carvalho/meraki-azure-ad
$ npm install
Provide the parameters in exports.creds
in config.js as instructed.
Update exports.destroySessionUrl
in config.js, if you want to use a different post_logout_redirect_uri
.
$ node app.js
You will have a server successfully running on http://localhost:3000
.
When the user selects the configured wireless SSID, a splash page will be shown prompting for their Azure AD Credentials.
Rafael Carvalho
2018
http://www.linkedin.com/in/rafaelloureirodecarvalho
Owner
Contributors
Categories
Products
MerakiProgramming Languages
JavaScriptHTMLLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community