No announcement yet.

Configuring Google Credentials (on Linux) (or Raspberry PI) (Also authenticator.exe)

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

    Configuring Google Credentials (on Linux) (or Raspberry PI) (Also authenticator.exe)

    Google use complicated authentication flow which requires starting a browser for authentication.

    Note: if your Linux install is headless (no Desktop Environment) - go to next post (#2 below).

    Problem is that HS is running as root (sudo) so it starts the web browser as root, which is not possible for popular browsers (i.e. Firefox) for security reasons.

    1. Google Chrome may work on Linux (not available for Raspberry PI). For instructions see the post #6.

    If Chrome didn't work (or for Raspberry PI) you need to install a browser which can run as root, I tested Chromium, GNOME Web and Epiphany.

    2. After installing the browser - make it default.

    3. To test if it's the default browser use xdg-open

    4. To test if the browser can run as root use sudo, i.e. sudo chromium-browser or sudo epiphany-browser

    5. Please login to (with your gmail account) in the selected browser

    6. Once you have the browser supporting root - follow instructions post #2 Configuring Google Credentials.

    If it works - congratulations.

    Using authenticator.exe for headless HS install

    If the HS is installed on headless (no GUI) Linux computer - the last reserve is to use authenticator.exe on another computer which does have GUI (better Windows) to obtain authorization token from Google. The app is included in the plugin install in "HS root"/bin/AKGoogleCalendar - copy the whole folder to Windows computer.

    Note 1: Before using authenticator.exe you still have to obtain (and save/Submit on the config page) ClientID and ClientSecret from Google - follow instructions post #2 Configuring Google Credentials.

    Note 2: On Linux even if you execute a command from the directory where it's located - you still need to prepend path, i.e:
    Note 3: And make sure on Linux it has the executable bit set, i.e:
    sudo chmod a+x authenticator.exe

    Now execute:
    authenticator.exe [I]ClientID ClientSecret[/I]
    It should request "User login & consent" and receive "Authorisation code" and on success print list of your calendars:

    Credential file saved to: D:\My\Temp\Release\token.json
    D:\My\Temp\Release\token.json\Google.Apis.Auth.OAuth2.Respon ses.TokenResponse-user
    S-Heat #f691b2
    S-Gates #16a765
    omeseer #fbe983 HS-TV #ffad46
    All you need to do now - in Google Calendar Credentials configuration click "Upload Credentials" and point to the file received above. This should copy the file to the plugin bin folder on HS machine.

    Alternatively you can copy created token.json folder manually to: "HS root"/Bin/AKGoogleCalendar/token.json"

    Then restart plugin.