Is it possible to "deep link" to attachments stored on feature layers in ArcGIS Server?
I would like to provide a URL link then when the link is clicked (or copied into a browser), the user is prompted for credentials, and then redirected to the attachment file (for viewing in browser or for download). In our current 10.3.1 ArcGIS Server / Portal for ArcGIS installation this doesn't seem to work...
background and details:
What I’d like to do is link to an attachment file (example, PDF or JPG) stored in an ArcGIS Server linked feature service layer attachment. An example URL that we are attempting to link to looks like this: https://www.ourserver.com/server/rest/services/TheFeatureService/FeatureServer/1/999/attachments/1
The problem is that when you click an HTML anchor tag using this URL as the href attribute, you first get routed to a login page for ArcGIS Portal (the ArcGIS Server instance is federated with Portal). This Portal login screen URL looks like this: https://www.ourserver.com/portal/sharing/oauth2/authorize?client_id=arcgisonline&response_type=token&state=%7B%22portalUrl%22%3A%22https%3A%2F%2Fwww.ourserver.com%2Fportal%22%7D&redirect_uri=https%3A%2F%2Fwww.ourserver.com%2Fserver%2Flogin%2F%3FreturnUrl%3Dhttps%3A%2F%2Fwww.ourserver.com%2Fserver%2Frest%2Fservices%3Fredirect%3Dhttps%253A%2F%2Fwww.ourserver.com%2Fserver%2Frest%2Fservices%2FTheFeatureService%2FFeatureServer%2F1%2F999%2Fattachments%2F1&hideCancel=true
This would be fine, but after successfully logging in, instead of being redirected back to the attachment file link of interest, you are instead routed to the REST endpoint “home page”. The URL that gets you there looks like this: https://www.ourserver.com/server/rest/services?redirect=https://www.ourserver.com/server/rest/services/TheFeatureService/FeatureServer/1/999/attachments/1
While there is a “redirect” argument/parameter in the query string, it doesn’t seem to do anything. The ArcGIS Server REST endpoint home page is shown as if there were no “redirect” argument, as if you were navigating to this URL: https://www.ourserver.com/server/rest/services
Interestingly, once you have successfully logged in and been routed back to the REST endpoint home page, you can then click the original HTML anchor tag link again and you are successfully routed to the attachment file link page.
This workflow should be possible (click a link, log in, view attachment). We can’t ask users to click the link, log in, close browser, click the link again, then finally view attachment…
We are using a slightly older version of ArcGIS Server/Portal for ArcGIS. We are at version 10.3.1. We do have the potential to upgrade to ArcGIS Enterprise 10.5, but “if it ain’t broke, don’t fix it”… And ArcGIS Enterprise 10.5.1 is coming in a few weeks.