I would confirm that you still need the groovy files if you have config as code, they might be overlapping quite a bit.
config as code example for using internal user db - configuration-as-code-plugin/demos/embedded-userdatabase at master · jenkinsci/configuration-as-code-plugin · GitHub