Skip to main content
Question

Oauth 2.0 token ESRI - not refreshing the token

  • January 20, 2025
  • 3 replies
  • 150 views

tfn_wv
Contributor
Forum|alt.badge.img+1

Dear community, 

I have implemented a workflow with FME and ArcGIS Enterprise, in which an automation is triggered in FME via a referenced feature service with a webhook. Based on the entries in the ArcGIS Field Maps App, an e-mail is then to be sent via FME.

This is set up accordingly according to the following documentation: https://support.safe.com/hc/en-us/articles/25407414850061-Integrating-ArcGIS-Enterprise-Feature-Service-Webhooks-With-FME 

The connection from the application in ArcGIS Enterprise to FME is also set up accordingly: https://support.safe.com/hc/en-us/articles/25407772142733-How-to-Create-an-ArcGIS-Enterprise-Portal-Web-Connection-OAuth-2-0 

The problem that arose is that the OAuth refresh token created in ArcGIS Enterprise has a default lifetime of 2 weeks and I therefore have to authorize myself every 2 weeks (see https://enterprise.arcgis.com/de/portal/latest/administer/windows/specify-the-default-token-expiration-time.htm).

Based on this community entry: https://community.safe.com/community-q-a-54/create-token-based-web-service-not-oauth-2-to-connect-to-arcgis-portal-from-fme-34792?postid=155325#post155325

I assumed that when i run a process with the webconnection, the refreshing of the refresh token will be made so the connection can be used longer than 2 weeks and I dont have to authorize myself every 2 weeks.

To renew the OAuth refresh token, a workspace that uses this web connection ran every 7 days in FME Server.

Unfortunately, that didnt work for me and after more than 14 days I had to “re-authorize” the web connection in the FME server GUI (entering the ArcGIS credentials).

Following the advice from the FME community, I have already created a new application in ArcGIS Enterprise Portal, which is only used in the FME server, as there could be conflicts when using one and the same web connection in several FME instances. But this did not work too.
 

Has anyone ever had the same or similar behavior?

Kind regards,

Tim

 

 

3 replies

todd_davis
Influencer
Forum|alt.badge.img+22
  • Influencer
  • January 20, 2025

Hi,

Safe have made lots of advancements in this space (based of improvement related to cases I have raised), so hopefully it should be all working very nicely by the 2025 version.

Attached is a workspace that will refresh a token in your esri environment. It is password protected due to me being cautious about what it does in the backend system, and not that it has something dodgy to hide. Running this process will update your existing valid refresh token, so if that fails, then there is something wrong with the setup.

To make it run, you just need to select the connecting you want to refresh (That connection needs to be authorised in the first place). The process will fail if the refresh token is not authorised when it runs, or when there is a problem with the service setup.

Here is its contents:

  

 


tfn_wv
Contributor
Forum|alt.badge.img+1
  • Author
  • January 23, 2025

Hello todd_davis,

Thank you so much for your answer!

Could you provide me the password for the workspace? I would love to check it out and understand how the process actually works.

Kind regards,

Tim
 


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • February 17, 2025

How do you have the refresh token parameters set up in your web service? I had to alter the request format from the Safe template in order to maintain connectivity. A workspace using the connection was running daily but would fail after a few days of working

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings