Skip to main content
Is it possible to use Web Connection authentication in the HTTPCaller transformer to access ArcGIS Online REST APIs without additional steps to obtain a token?

I also have this question! It looks like no to me-- at least, when I try I am just getting "Token Required" responses


Hi @Andrew Collins​ ,

 

Some of the AGOL REST API endpoints do require token authentication. We can configure our web connection to handle both OAuth and token authentication methods, saving us from those additional steps in the workspace.

 

In Manage Web Services, add a new Web Service with the Create From... > Esri ArcGIS Online template: 

CreateNewWebServiceIn the new template, configure the API Call parameters so that Placement is Both and the Token Item Key is token:

APICallParametersSave the new web service, then use it to create a new web connection to AGOL. After connecting, try using that new web connection with the REST API call. 

 

Please let me know if you have any issues!


That was really helpful @sanaeatsafe​ I hadn't seen that on the AGOL Web Connection before!

Further to that though, I have a related question with the ArcGIS Portal Web Connections and tokens.

 

Some other ArcGIS REST API calls require the token to be uploaded in the body of the request (rather than header or query string). Do you know if it's possible to use the Web Connection to request a token and expose it as an attribute within a workspace?

 

The call in particular I am trying to make is a geoprocessing tool to create a print-map (like you would within an application).

https://developers.arcgis.com/rest/services-reference/enterprise/exportwebmap-specification.htm

 

image.png 

This is quite cumbersome, as the token must be specified within the JSON request for each layer which makes up the map. The Web Connection works in order to execute the Geoprocessing tool itself, but doesn't provide the correct authentication to access the layers when executing that tool.

 

Is there a way to use the Web Connection to retrieve a token within the workspace?

 

I'm stuck at trying to retrieve a token like I normally would with ArcGIS Online, as this organisation uses SAML, and I can't seem to get through the separate stages which the Web Connection handles - looping you through the corporate identity provider.

 

Thanks

 

 


Reply