Moved the logic for authentication methods to dirg-util.