add code to pass and check authentication key from both sides
not test yet