Gets the username of the Credentials object
the object whose username is to be set.
the username if the object is valid, null otherwise.