Unable to authenticate using custom realm example code security-example-spi-extension

I found that I needed this line in my elasticsearch.yml which wasn't mentioned in Integrating with other authentication systems | Elasticsearch Guide [8.12] | Elastic

xpack.license.self_generated.type: "trial"