add client auth stuff and enhance DocumentId