added basic and digest authenticate support Fixed #12