improved my authentication demo

fixed some bugs with my authentication code port/wrapper