Set username when the authentication is performed

We support two types of auth:

 - normal (authenticated when the object is created)
 - delayed (we don't know the username until the authenticate method is called)

This change prevents problems in the second case.
avoid memoizing the base for the cache key if the username is None
ready for 0.25.1