GoogleWebAuthorizationBroker.AuthorizeAsync is not working on localhost but not working in server
As there isn't any code details or error details, so I can suggest this code
private static readonly IAuthorizationCodeFlow flow =
new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer
{
ClientSecrets = new ClientSecrets
{
ClientId = "PUT_CLIENT_ID_HERE",
ClientSecret = "PUT_CLIENT_SECRET_HERE"
},
Scopes = new[] { DriveService.Scope.Drive },
DataStore = new FileDataStore("Drive.Api.Auth.Store")
});
Consider checking these links
https://github.com/googleapis/google-api-dotnet-client/issues/888
https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc
Thanks
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly