Anonymous iframe access requires a reverse proxy setup. You can find an example of nginx configuration at Auto-authenticating to iframe-embedded Kibana dashboard
Here is an open issue https://github.com/elastic/kibana/issues/18331 that you can track for supporting anonymous iframe access without a reverse proxy.