Add authenticate method

If authentication is enabled in HandlerSocket you need to be able to authenticate before any other operation. The added code does just that.