How to reload the AGSServiceFeatureTable, when using ArcGIS Server Service with pre-aquired token.
You can create AGSCredential object using initWithToken:referer: method and set it on `credential` property of `AGSServiceFeatureTable` object. You can either add it to map/scene or call `load` on it.
Hope this helps!
Regards,
Nimesh
Nimesh - I have initialized table with token, I need to update the table with new token after it expired.
Which steps did you take to `initialize table with token`? Did you follow the steps I outlined above? The `token` property is `readwrite` on `AGSCredential`. You can set a new token on it.
I was creating new AGSCredential and setting the table property with the new one, that wasn't working. Now, I just tried updating the token value directly for layer credentials and seems to be working.
Thanks for the help!
This is slightly different question.
Does the token value in portal.credentials?.token gets automatically updated when token expires , and new token is generated by Auth Manager.
Yes, if you provided the `username and password` in the credential. In order to refresh the token it is required. But if you have created credential using `token` and `referer` then we can not refresh it.
I am just using the auto generated oAuth Page
self.portal = AGSPortal.init(url: URL(string:AppConfiguration.portalUrl!, loginRequired: true)
self.portal.load { (error) -> Void in
//....
}
And at somepoint later in the app, on user defined action, I need to get the token from
"self.portal.credentials?.token"
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.