Need to return nil from credentials-fn on failure.