Refactor hard-coded Basic and Digest Auth to adopt re-usable strategy