I am working on improving the security of access to services.
I have used the ESRI technical document
https://support.esri.com/en-us/knowledge-base/how-to-limit-access-to-secured-hosted-services-or-map-...
"Limit access to secure hosted services or map services in ArcGIS Online for public web apps".
1-. I am using Web App Builder
2-. Configure the URL of the entity to be consumed by the APP and the map service.
I have the following problem.
1-. When configuring the app widgets (for example the search engine) they cannot access the entities hosted in the map service.
2-. I use the entity (not public) as a source for the search engine widget configuration.
3-. When I make the service public, it is not accessible and it asks me for access credentials.