adding code for client auth