The Google Blogger v3 API doesn't use the Atom protocol, so I added a
new Google Blogger v3 client to handle the connection instead. I updated
the Google Blogger detector to use the new OAuth APIs when attempting to
detect a Google Blogger blog. I also had to change some logic around for
homepage URLs. The main difference in the Google Blogger flow is that
the homepage URL isn't known until after the credentials are authorized.
All other blogs require the user to type in the homepage URL manually
before authorization happens, so I had to change some logic for this to
work properly.
The 'Sign in' button now automatically disables itself and changes text
dynamically to help make sure users know when they need to click it,
made the authentication panel automatically click the 'Next' button on
behalf of the user when it detects valid user credentials. I also
changed the FileDataStore to store one OAuth2 token per blog rather than
create a new folder per blog.
Most blog APIs take a simple username/password pair and our
IBlogCredentials are based around this concept. For OAuth, there is more
to store than just a simple username/password. The Google APIs already
provide an option to automatically handle the data storage for the
OAuth, so I'm using that instead.
Google asked us not to check in the client id and client secret into the
source. Instead, we'll generate a client_secrets.json at runtime based
on environment variables. Developers that want to build the source code
locally will need to supply their own client ID and client secret. For
the official Open Live Writer installer, we'll make sure the client ID
and client secret are set to the official Open Live Writer client.
Fix postinstaller to be more tolerant: (i) Use quote marks to ensure spaces in the user profile directory (e.g. C:\Users\Tim Sneath) don't break the batch file; (ii) fail more gently if Nuget.exe isn't in the %localappdata% directory, since it's not installed by default with Visual Studio.