Deprecting setCredential method