Implements authentication as a preprocessor.
Fix issue #139.