Using credentials provider instead of credentials directly.

This make the credentials be refreshed automatically.