Open
Description
Background
ArcGIS Server tries to validate any token passed in a request whether or not authentication is needed for that request. This can lead to a scenario such as the following:
Bob creates a Feature Service
item on ArcGIS Enterprise for a public feature service on AGOL. The consuming application sends an ArcGIS Enterprise authentication token in requests to the AGOL service. The service tries to validate the token with AGOL and fails, preventing the request from succeeding. If a token is not sent, the request is successful since the service is public.
Solution
A simple and bullet-proof approach to solving this would be to
- Make the request with authentication
- If it fails with an ArcGIS Auth Error, make it again without authentication