How can I use a Google Workspaces (gsuite) user's application specific password to sign into Google's OIDC (OpenId Connect) auth endpoint and request an OIDC ID Token for that user?
Background:
Google turned off support for programmatic password-based authentication to gsuite and Google Workspace saying:
“Blocking sign-ins from less secure apps helps keep accounts safe. For these reasons, Google is limiting password-based programmatic sign-ins to Google Accounts.” Google: Control access to less secure apps
As an alternative to LSA (Less Secure Apps) Google suggests that apps can use "application specific passwords" to programmatically authenticate to Google.
An app password is a 16-digit passcode that gives a non-Google app or device permission to access your Google Account. To help keep your account secure, use 'Sign in with Google' to connect apps to your Google Account. If the app that you’re using doesn’t offer this option, you can either: Use app passwords to connect to your Google Account ... Gmail: Sign in using app passwords.
Google recommends using an App Password as one solution for applications that require programatic sign ins to Google accounts:
Can’t use an app with my Google Account: Use an App Password Google: Less secure apps & your Google Account
This clearly indicates that Google intends for applications to programmatically sign into Google Accounts using app passwords but forbids programatic access for regular passwords. I can find no documentation on how to do this.
My question is: how can I use an app password of a user to sign into Google's OIDC (OIDC Connect) auth endpoint and request an OIDC ID Token for that user?
I can find examples of this being done for Google Workspace SMTP to access email. For instance Google only allows nodemailer to programmatically access gmail via the SMTP protocol using an app password. This however does not help me because SMTP being a email transfer protocol can not issue OIDC ID Tokens.
Out of scope answers:
- This is not a question asking how to create GCP service accounts and use domain wide delegation to enable them to impersonate a Google Workspaces user and thereby request an OIDC ID Token for that user.
- It is not a question asking how to create an OIDC confidential client and then given that OIDC confident client access to your Google account to request an ID Token.
I am not looking for these answers.