I have a winforms application. This application basically for backup and restore. Users can be login to their own google drive accounts and use google drive for download and upload files. All users enable their own google drive API and use the credentials of that account. Is that a rigth way or not?(#1 question)
I am already using google drive api (v3) for this but the authentication method does not work as expected.
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = this.ClientId,
ClientSecret = this.ClientSecret
},
_scopes,
Environment.UserName,
CancellationToken.None,
new FileDataStore("Drive.Api.Auth.Store")).Result;
This code work in local and also work in production. But when I obfuscate(obfuscator: confuserex) the code, this method throws an error. Error;
One or many error occurred
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) location: System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) location: System.Threading.Tasks.Task`1.get_Result() location: App.Driver.GoogleDrive.DriveConnection.Authentication()
I wondered can I authenticate users with different way?(#2 question) Like, open a google drive login page and users can be login from it or something like that.
Note: At the first login with this code, the google drive login page was opened and I logged into my account and got permission for the google application. And then the web page turns to the api key. But this only happened for fist time. I don't have a good information about this. I followed this tutorial;