AnsweredAssumed Answered

Hyperlinks to secure hosted service attachment URL endpoint in popups

Question asked by SBerg_VHB on Nov 29, 2016

Hi- thanks for any thoughts on this one:

I have a custom webmap popup for a layer in which I would like to link to an endpoint of a hosted feature service.

For example:

<a href='http://services1.arcgis.com/MyOrg/rest/services/MyService/FeatureServer/1/7/attachments/7'>Document<

/a>

Since it is a secure service, the direct hyperlink will open an ArcGIS Service REST Directory message of "Token Required".   If you go through the item description page for the service first, the attachment loads because the address has been augmented with a token.  

 

1) Is there a way that I could configure the hyperlink through a token generation page?  I don't think the generateToken operation allows for redirection(?).

2) I looked at OAUTH app authentication using a clientId which CAN redirect to the endpoint, ie: 

https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=YOUR_APPLICATIONS_CLIENT_ID&response_type=token&expiratio… 

However, the ACCESS token which gets passed to the underling hosted service does not authenticate and the Token Required page is returned.

Hope this all makes sense.  Thanks for any ideas.

Sam

Outcomes