Added support for network authentication. Ripped from Nimbus.