add: Allow caller to supply unique reference.

Being able to specify reference is useful to ensure consistency
during upgrades in a cluster of IdP:s.