@@ -302,16 +302,19 @@ There are two ways to handle OAuth authentication with Google:
302302 executed to obtain a fresh access token on demand. Vdirsyncer passes the
303303 token as a ``Bearer `` header and re-runs the command on 401 responses.
304304
305- With ``token_command ``, you do not need to register a Google Cloud project or
306- install ``aiohttp-oauthlib ``. Any OAuth helper that prints an access token to
307- stdout works, e.g. `oama <https://github.com/pdobsan/oama >`_::
305+ With ``token_command ``, vdirsyncer doesn't need OAuth credentials or
306+ ``aiohttp-oauthlib ``. The external helper handles Google registration. The format is
307+ ``["strategy", "arg1", ...] ``, same as :ref: `the .fetch config values
308+ <fetch_params>`. Supported strategies are ``command `` (exec directly) and
309+ ``shell `` (run via shell)::
308310
309311 [storage my_google_cal]
310312 type = "google_calendar"
311- token_command = ["oama", "access", "my-google-account"]
313+ token_command = ["command", " oama", "access", "my-google-account"]
312314
313- The command can be specified as a list (executed directly) or a string (run via
314- shell).
315+ Or using a shell command::
316+
317+ token_command = ["shell", "oama access my-google-account"]
315318
316319Built-in OAuth setup
317320++++++++++++++++++++
@@ -381,10 +384,12 @@ itself or write anything to it.
381384 :param client_id/client_secret: OAuth credentials, obtained from the Google
382385 API Manager. Optional if ``token_command ``
383386 is set.
384- :param token_command: Command to fetch an OAuth access token. Can be a list
385- of arguments or a string (run via shell). The command
386- must print a valid bearer token to stdout. When set,
387- ``token_file `` and OAuth credentials are not required.
387+ :param token_command: Fetch strategy for OAuth access token, same format as
388+ ``.fetch `` params: ``["strategy", "arg1", ...] ``.
389+ Supported strategies: ``command ``, ``shell ``.
390+ The command must print a valid bearer token to stdout.
391+ When set, ``token_file `` and OAuth credentials are not
392+ required.
388393
389394.. storage :: google_contacts
390395
@@ -404,10 +409,12 @@ itself or write anything to it.
404409 :param client_id/client_secret: OAuth credentials, obtained from the Google
405410 API Manager. Optional if ``token_command ``
406411 is set.
407- :param token_command: Command to fetch an OAuth access token. Can be a list
408- of arguments or a string (run via shell). The command
409- must print a valid bearer token to stdout. When set,
410- ``token_file `` and OAuth credentials are not required.
412+ :param token_command: Fetch strategy for OAuth access token, same format as
413+ ``.fetch `` params: ``["strategy", "arg1", ...] ``.
414+ Supported strategies: ``command ``, ``shell ``.
415+ The command must print a valid bearer token to stdout.
416+ When set, ``token_file `` and OAuth credentials are not
417+ required.
411418
412419The built-in OAuth flow is not ideal, but Google has deprecated the previous
413420APIs used for this without providing a suitable replacement. See :gh: `975 ` for
0 commit comments