[2.7.x] NEXUS-6277: Minimal authc optimization

Original PR
https://github.com/sonatype/nexus-oss/pull/354

Issue
https://issues.sonatype.org/browse/NEXUS-6277

CI
https://bamboo.zion.sonatype.com/browse/NX-OSSF57