#18 commonize to XCAuth