Is it possible to keep server connection credentials hidden?

Is it possible to do what the title says in order to allow connections to a server only through an add-on and prevent random users accessing the server?