Adding set_credentials function.