Hardware Reference
In-Depth Information
Do not confuse a user directory with a ilesystem directory - although they use the same
word, they are separate unrelated concepts.
A better solution would be to keep all the information stored in one place, on a central server.
With this approach, when a user requests access to a resource (that is, he or she wants to
open the door) his or her credentials are sent to the directory server over the network, which
grants access or not. A similar process is used online to allow users to log in to other websites
using their Twitter or Facebook accounts.
Authentication and Directories in Industry
The standard way to share and store authentication information is the lightweight directory
access protocol (LDAP). Its history can be traced back to the 1980s around the time of the birth
of the Internet. Nowadays it is the basis for Active Directory, the system used for network user
management on Microsoft Windows. Linux supports running LDAP servers and user logon
through open-source implementations of LDAP. The main version for Raspbian is OpenLDAP.
If you own multiple Raspberry Pis, you could network them and manage who can log in to
them centrally. You could perhaps manage a classroom of Raspberry Pis for a school this way.
There would be no difference between this setup and the way large institutions such as
banks, universities or ofices manage all their machines and users. There are tutorials online
that show how to set up an OpenLDAP server and client speciically on Raspberry Pis.
In your door lock program, because the authentication is separated into a class, you can eas-
ily replace it with a network version that would look the user's input up in a directory or
other authentication service. You could even replace it with code that sends the user's input
to validate against Facebook. Clearly putting a Raspberry Pi next to every door in your house
starts becoming expensive, but there are a number of other fun ways you can expand the
project which do not require additional hardware.
Over to You
his project, like all the others in this topic, has many opportunities for extensions. Why not
try swapping out one or more input, authentication and output blocks to implement some of
the following:
You could have the lock greet the user and announce that access has been granted.
Make use of the code for text-to-speech in Chapter 10, “he Twittering Toy”.
 
Search WWH ::




Custom Search