Completes authentication functionality