So I followed a few examples from http://www.daimto.com/, namely http://www.daimto.com/webmaster-tools-api-with-c/. After a long night I was able to get it to work. the way I did that is by simply removing
new FileDataStore("Daimto.GoogleWebMasters.Auth.Store")
changing the code to:
UserCredential credential = GoogleWebAuthorizationBroker(new ClientSecrets
{ ClientId = clientId, ClientSecret = clientSecret }
, scopes
, userName
, CancellationToken.None
, null).Result; // <-- notice null here
So is the datastore really necessary? when I add it, my IIS is generating a new port number each refresh, making it impossible to authorize url redirects in google. btw, I tried the physical full path of the directory, but it results the same.