This change unifies the use of authenticator for legacy repositories. This ensures that we retrieve the correct credentials in all cases. Relates-to: #2799 #2988