Backport fix to allow third party authentication modules.