As far as I know, the username and password supplied by the user should be used to obtain the new token once the old one expires. If that is not the case, then that is a bug in the API.
I have another suggestion to try:
Instead of using the AuthenticationView, you could connect to the AuthenticationManager and respond to credential challenges there. You can intercept the challenge and respond to the challenge programmatically
Something like:
Connections {
target: AuthenticationManager
function onAuthenticationChallenge(challenge) {
const credential = ArcGISRuntimeEnvironment.createObject("Credential", {username: "", password: ""});
challenge.continueWithCredential(credential);
}
}
Here is the doc on that https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-authenticationmanager.html