After hours of testing I found it out by myself. Use the main instance to ensure that you call the function "createAuthenticationProvider" on the master. I put this functionality in a separated method of the plugin:
private ISVNAuthenticationProvider createAuthenticationProvider(AbstractProject context) {
return Hudson.getInstance().getDescriptorByType(SubversionSCM.DescriptorImpl.class)
.createAuthenticationProvider(context);
}
During the execution of the plugin you can generate a valid AuthenticationProvider by calling the method:
createAuthenticationProvider(build.getProject())