Announcement

Collapse
No announcement yet.

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

Collapse
This is a sticky topic.
X
X
 
  • 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 http://google.com

    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 google.com (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.

    #2
    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:
    Code:
    ./authenticator.exe
    Note 3: And make sure on Linux it has the executable bit set, i.e:
    Code:
    sudo chmod a+x authenticator.exe

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

    Code:
    *********************************************
    Credential file saved to: D:\My\Temp\Release\token.json
    
    D:\My\Temp\Release\token.json\Google.Apis.Auth.OAuth2.Respon ses.TokenResponse-user
    
    *********************************************
    pp08kp35e77ap05mmm94a00gmk@group.calendar.google.com
    S-Heat #f691b2 i04d1nir7395dmril3dvpstijg@group.calendar.google.com
    S-Gates #16a765 jgcuopiksi78f231qq5t23b2pg@group.calendar.google.com
    omeseer #fbe983 95dfa41185hao6gmvpss2nelro@group.calendar.google.com 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.

    Comment

    Working...
    X