Base Authentication class. Support for django 1.4.