QML ArcGIS Runtime API - generate a new token

1578
15
09-14-2022 06:13 AM
GISiste
Occasional Contributor

Hello everyone, 

I'm actually working on app mobile (doing some basics functionnalities like displaying data and searching the itineraire). The data is a simple web map with a featurelayer stored in the portal federated with the ArcGIS Server

The user can use her enterprise account to access to the portal then get the token to display the web map and the data. The token has 30 minutes to expire.

Now, I would like to generate a new token once the old one has expired without displaying the popup authentication. 

I am a junior in QT and ArcGIS Runtime API for QML and any advice is the most welcomed

 

Thank you for the help

0 Kudos
15 Replies
GISiste
Occasional Contributor

Hi @DavidPuckett 

Is that worked for you ?

Thanks

Regards

0 Kudos
DavidPuckett
Occasional Contributor

Setting the refreshTokenExchangeInterval on the oAuthClientInfo did not work to automatically refresh the token at the set interval.

DavidPuckett
Occasional Contributor

Hmmm @LucasDanzinger this did not work. I set the refreshTokenExchangeInterval on the oAuthClientInfo to 30 but it did not work to automatically refresh the token at the set interval. I started the app and let it sit for 30 minutes and sure enough it timed out. Any other tips? Is it dependent on any other properties?

LucasDanzinger
Esri Frequent Contributor

we are looking into this still

0 Kudos
DavidPuckett
Occasional Contributor

Appreciate the update. This has turned into a potential issue for us so any further info you can provide would be much appreciated.

0 Kudos
DavidPuckett
Occasional Contributor

Following up to learn if there is more info here. I have since implemented a solution that refreshes the token via a NetworkRequest put on a Timer which works most of the time. However, if the app idles too long in the background the timer will not fire to refresh the access token and the app loses access. This is especially difficult because there is no indication to the user at all. It just doesn't work and there isn't then a way to refresh the token unless I implement a manual way to refresh, inelegant. Any word on whether the refreshTokenExchangeInterval workflow has a workaround here @LucasDanzinger ?

0 Kudos