viciousviper / DokanCloudFS

A virtual filesystem for various publicly accessible Cloud storage services on the Microsoft Windows platform.
MIT License
312 stars 54 forks source link

Testing Authentication before mounting #4

Closed Liryna closed 8 years ago

Liryna commented 8 years ago

DokanCloudFS request login (for onedrive at least) for each request when the credential are wrong. It would be great that DokanCloudFS test the credential before mounting.

viciousviper commented 8 years ago

@Liryna: Sorry for the delay - got bogged down by problems with the upgrade of my development rig to Windows 10. Will get back on track during the coming week. Cheers vv

viciousviper commented 8 years ago

Hi Liryna,

I've finally gotten around to addressing this very old issue and I'd like to discuss the best way of fixing the present unwanted behavior.

What we're seeing is that when the initial authentication for a cloud drive right after its being mounted fails - because the user aborts or closes the login window or possibly enters invalid credentials - additional instances of the login window keep popping up until hell freezes over.

Your suggestion of checking credentials before mounting does not integrate well with the current control flow in CloudFS/DokanCloudFS because authentication is presently triggered on demand for whatever API method is called first on a specific cloud drive. Since the CloudFS gateways could in theory be used in other contexts than a Dokan-based file sytem driver, I'd rather keep this very generic approach to authentication.

Having said this, do you know of any means to signal a persistent authentication failure back to the Dokan driver via an NtResult and thus keep it from calling the same API method (specifically DokanOperations.GetFileInformation("\", ...)) all over again in spite of repeated errors? I have so far tried

but nothing appears to stop the cycle.

Any ideas?

Liryna commented 8 years ago

Hi @viciousviper ,

I would propose NtResult.AccessDenied as you proposed but as you seen, the API method continue to be called because explorer or what ever, continue to ask to the system.

There is no possibility to check the credential before calling the mount ?

viciousviper commented 8 years ago

This 0b04378 should settle it.