Add support to re-authenticate if credentials expire, Issue #1