Google Calendar OAUTH in headless centos/ubuntu mode

116 views
Skip to first unread message

Ravi. L. Honakere

unread,
Sep 6, 2017, 3:02:52 PM9/6/17
to Google Calendar API
Hi there - typically while doing an initial handshake with Google API like Calendar/Email, an URL gets kicked-off like below
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=<clientId>.apps.googleusercontent.com&redirect_uri=http://localhost:44538/Callback&response_type=code&scope=https://www.googleapis.com/auth/calendar
which persists /.credentials/calendar-java-quickstart.json/StoredCredential as an one-time effort.

However in headless centos mode, WHAT's the SOLUTION? Any pointers are helpful

I tried below, however with no successful results:

*************

Install OPAM [Reference: http://opam.ocaml.org/doc/Install.html]

[wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin]


After Installing OPAM, install google-drive-ocamlfuse [Reference: https://github.com/astrada/google-drive-ocamlfuse/wiki/Installation]

opam init

opam update

opam install depext

opam depext google-drive-ocamlfuse

opam install google-drive-ocamlfuse


Setup env variable of above installation:

open ~/.opam/opam-init/variables.sh

export PATH=$PATH:/home/<user>/.opam/4.05.0/bin


Retrieve clientId and clientSecret from client_secret.json:

google-drive-ocamlfuse -headless -id=<clientId>.apps.googleusercontent.com -secret=<clientSecret>


<user>-wsl:~$ google-drive-ocamlfuse -headless -id=<clientId>.apps.googleusercontent.com -secret=<clientSecret>

Please, open the following URL in a web browser: https://accounts.google.com/o/oauth2/auth?client_id=<clientId>.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar&response_type=code&access_type=offline&approval_prompt=force

Please enter the verification code: <code>

Access token retrieved correctly.


Reply all
Reply to author
Forward
0 new messages