Generating an Application Token via ArcGIS Online

1466
2
12-28-2017 02:47 PM
MarkJones8
New Contributor

HI,

I'm trying to generate a token to apply to an AWAB application URL hosted via an ArcGIS Online organisation so that I can provide an AGOL AWAB to a group of external users.  Via Portal I'd use the GenerateToken option via the Portal sharing API, i.e. https://{portalname}/portal/sharing/generateToken, giving me something like URL&token=abcdefg....

Is this doable via an AGOL organisation?

Thanks in advance.

0 Kudos
2 Replies
KellyGerrow
Esri Frequent Contributor

Hi Mark,

This isn't recommended as any user can then use the token to access any part of your organization, data, users, functionality as you. This could potentially be a large security hole. 

If you are looking to share your application, consider sharing the application publicly or creating a group and sharing the app, data and web map only with the group of users that should access it. They will require an ArcGIS Online account in order to use this security method.

Here is a link to some developer Authentication help:

Get an access token | ArcGIS for Developers 

https://community.esri.com/community/gis/web-gis/web-appbuilder?sr=search&searchId=28c29a76-9158-4ee...

-Kelly 

ArthurXiao
New Contributor II

Hi @KellyGerrow 

We can get token with https://www.arcgis.com/sharing/generateToken by POST method and following format of parameters:  f=json&username=USERNAME&password=PASSWORD&client=requestip

But when use that token to query a hosted Survey123 result feature service on https://services3.arcgis.com, got following error: {"error":{"code":498,"message":"Invalid token.","details":["Invalid token."]}}

Any help? Thanks.

0 Kudos