Hey guys,
I've been on here awhile lately so just wanted to thank everyone for their help.
I am nearly at the end of finishing my concept and as it is apart of an organisation we are using 365 as an authenticator. I have used the Token Auth sample to login to the app that uses a webmap. It logs in without an issue but after 60mins it seems to timeout and gives me an error from the Arcgis rest service (403) which hosts some of the layers I am using.
Has anyone seen this issue before? Below is my Portal code... I have been playing around with the refreshtoken properties but had little to no change.
id: portal
url: "Hidden from forum"
credential: Credential {
oAuthClientInfo: OAuthClientInfo {
oAuthMode: Enums.OAuthModeUser
clientId: "Hidden from forum"
clientSecret:"Hidden from forum"
redirectUri: "Hidden from forum"
refreshTokenExchangeInterval: 55
refreshTokenExpirationInterval: -1
}
}
Component.onCompleted: {load();
}
}
Ive also used my webmap on fieldmaps to see if it would throw the same error but it continues to work with no issue.
I'm a novice to all of this so any help or guidance would be appreciated.
Thanks in advance.
Eric
Hi Eric,
When "refreshTokenExpirationInterval" is set to -1, the token is considered to be permanent and is never refreshed. "refreshTokenExchangeInterval" is ignored in this case and that can cause invalid access due to expired token.
Try to use a long expiration interval:
refreshTokenExchangeInterval: 55
refreshTokenExpirationInterval: 129600 // 90 days
Thanks for the reply,
This is how I initially set it up but didn't seem to work. Also I have been told by my organisation that we don't use tokens anymore so don't have a clue how to now approach this issue.
Any direction or guidance would be appreciated.
Cheers,
Eric
So I think I have narrowed it down, its the Client Certificate that is causing the issue. I have found a property that I think will fix my issue (credentialCacheEnabled ). The issue I have now is trying to insert it in AuthenticationManager. This is what I have tried but comes up with an error of "element is not creatable (AuthenticationManager)". I am running 100.10
AuthenticationView {
anchors.fill: parent
AuthenticationManager {
credentialCacheEnabled: true
}
}
Once again thanks in advance.
Cheers,
Eric
Hi Eric,
AuthenticationManager is a singleton, you can't create this object. You can use it directly:
Component.onCompleted: {
AuthenticationManager.credentialCacheEnabled = true;
load();
}
But credential cache is enabled by default.
I'm not sure to understand why you have this error. Can you try without refreshTokenExchangeInterval and refreshTokenExpirationInterval?