Add authentication scheme selection

Authentication scheme can be basic or digest.
The default digest behavior has been kept.