Anonymous login not working in Kibana 9.0.2

As part of my Kibana config i have adde dbelow code,

xpack.security.authc.providers:
  anonymous.anonymous1:
    order: 0
    session:
      idleTimeout: 1y
  basic.basic1:
    order: 1

when i try to bring the servr up getting below error,

\u001b[37m\u001b[41m FATAL \u001b[49m\u001b[39m TypeError: Cannot read properties of undefined (reading 'apiKey')

any suggestion on how to fix it would be helpfull.