Long-lived tokens in ArcGIS Online?

1998
4
10-12-2017 07:19 AM
zkovacs
Occasional Contributor III

I have an issue I could work around but was wondering if there is any way to get AGOL to generate long-lived tokens (like the namesake in AG Server) for items like PDFs, Word Docs etc.

I issue I have is that I have some PDF files with engineering plans (uploaded and stored in AGOL) I need to add as links to a Story Map. When I click on a PDF item in My content and then open the file, I can see that a token is generated to allow access and display of the content. The problem is that this token is short-lived and only works for a limited time (maybe a week?), so it stops working when the token expires.

The "workaround" I can think of is to use the link to the PDF item in the Story Map, and then have the user to click manually on the download button if they want to see the content. This works fine, but it is clunky and breaks the user experience which is the whole point of Story Maps isn't it?

Is there a way to get long-lived tokens generated in AGOL so we can link and open PDF (and other document) items with a direct link containing the token? I couldn't find any option in the REST API/admin part of AGOL in a quick search, but I'm hoping an expert from Esri could help me out with this. Thanks in advance!

Zoltan

0 Kudos
4 Replies
MichaelKelly
Occasional Contributor III

Hi Zoltan,

Are the content items you are using shared publicly?

If so, you can use the ArcGIS Online Item URL (e.g. https://esriireland.maps.arcgis.com/sharing/rest/content/items/3058e863dc484e0ca57bd704af47cee3/data). You'll notice that this URL redirects to Amazon S3 (e.g. https://ago-item-storage.s3-external-1.amazonaws.com/3058e863dc484e0ca57bd704af47cee3/AshtownGateDub... ) with the relevant token attached.

If the item is not shared publically, I am not aware of a way to generate a long lived token (for longer than 2 weeks) for ArcGIS Online. Even if you could, the token would technically give anyone access to any permissions associated with the account that the token is generated from.

Mikie

0 Kudos
zkovacs
Occasional Contributor III

Michael,

Thanks for tip. The PDF items were only shared with a group, but it's good to know if they are shared publicly then the token will be long-lived.

Zoltan

0 Kudos
MichaelKelly
Occasional Contributor III

Hi Zoltan - just to clarify, when an item is shared publicly, a token is not required (as opposed to being long-lived).

Mikie

0 Kudos
zkovacs
Occasional Contributor III

Ah, right. Thanks for the clarification, Mikie.

0 Kudos