First implementation of traditional login for phonegap compat.