Bug #5772 add ejb authentication for remote use

fixing bug #5772