Added code to make authentication optional.