Added support for custom Credential objects