added ability to pass in mid. this is used by systems that are proxying a login from a remote client