Register a custom authenticator doesn't seem to work

Silverstripe Version: 4.7


I was trying to register a custom MemberAuthenticator as default authenticator in my app.yml as in the example shown below. However, I get the error “Uncaught Symfony\Component\Yaml\Exception\ParseException: The reserved indicator “%” cannot start a plain scalar; you need to quote the scalar”.
When I quote the whole thing it doesn’t cause an error, but my authenticator isn’t being used. Same when removing %$ (here I also tried with and without quotes) it just always falls back to the regular MemberAuthenticator. Is there anything I might be doing wrong?

My custom handlers work absolutely fine.

Name: MyAuth
  - '#coresecurity'
        default: %$MyVendor\MyProject\Authenticator\MyAuthenticator

Managed to get my Authenticator registered by using the following code

    class: MyVendor\MyProject\MyCustomMemberAuthenticator

Not sure if this approach is ideal, so far it did work for me. However, I’d be happy if someone could clarify as to why the approach suggested in Silverstripe 4 docs doesn’t seem to work as it should.