O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Authenticating users

Our last task before the web page is complete is to provide some minimum form of protection by providing a login page. A user must be logged in to be able to view the data of the device or control its output.

The Markdown engine allows us to implement simple login pages. It is done by providing two header fields, Login and UserVariable. What they do is tell the parser that the page can only be viewed if a Waher.Security.IUser object is defined in the current session, with the variable name defined by the UserVariable header. If no such variable is found, the client is redirected to a new page, defined by the Login header. So, we begin by adding the following two rows to the Index.md and History.md files in the sensor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required