A Python3 script that authenticates users based on their Google account, using OpenID connect. It uses Proof Key for Code Exchange (PKCE) for security.
python -m pip install requests python -m pip install pyjwt
Obtain a client id
and a client secret
following these instructions.
Make sure that in Google console you have added openid
scope in the OAuth consent screen
and you have define the Application type
to be Desktop
.
Put your client id
and client secret
in lines 13 and 14 of the script.
Simply execute:
python3 google-openidc.py
You can read my blog post. Open an issue if you need support.