Passing optional data to credential function.