Set authentication credential. uri == nil for generic purpose (allow to use user/password for any URL).
[Validate]