Am using Map Network Drive in Windows Explorer to add a Sharepoint folder. This link is valid for the lifetime of the security token that Sharepoint returns (say 10 hours). When the token expires, the only way to access the mapped drive is by re-logging on to Sharepoint online from the browser.
Is it possible to programmatically refresh the token pre or post expiration using cached credentials that avoids this re-logon step, say through a console app that can be run manually or scheduled? I have come across several samples that login to SPO by supplying a username and password, but this won't work in my case because SPO is configured to use windows authentication via ADFS. I have also come across samples that modify the global.asax to refresh the token, but not sure if this will work in my case either, because the SP installation is in the cloud and I don't know if I can modify global.asax in this case.