Hi Darek,
to answer your questions:
- Have you tried to run Fiddler (or something similar) to log the network traffic when you encounter the 401 error when trying to query the feature service with joined table? Do you see any error messages?
Yes, I'v used Fiddler and Chrome Developer tools to monitor the traffic, same result: 401 error, invalid credentials. but this only happens when I have joined tables in the service, and only in this circumstance, Web Appbuilder will use proxy:
https://localhost:3344/proxy.js? url_for_query
- What type of security has been configured on your Portal for ArcGIS? Built-in? IWA? SAML?
It's IWA
- Have you enabled anonymous access to your Portal?
Yes. the boxes are ticked for "Allow anonymous access to your portal" and "Allow access to the portal through HTTPS only"
- Does your web app require a login to access? If so, does that user have the appropriate permissions to the data being queried?
No, the application does not require a login, and the services are not secured.
- In your 2nd post, when you say you enabled Anonymous Authentication for a web adaptor, which one? For the GIS Server? For Portal?
The web adaptor for the GIS server.
- Try accessing the feature service with the joined data in the Portal map viewer, can you see the data contents?
I can access the service from Portal map viewer. and if I copy the URL after the proxy.js and past it in the address bar of a browser, let's say Chrome or IE, the query works.
So, I still strongly suspect the Web Appbuilder proxy.js can't handle the IWA and properly pass on the right credential to the GIS server while IE or Chrome can.
Please be aware that the GIS server is federated with Portal, this may affect its authentication mechanism.
Thank you for your attention to this question, look forward to more advice from you.
Cheers,
Simo