apps-script-oauth2 icon indicating copy to clipboard operation
apps-script-oauth2 copied to clipboard

I am unsure what happened that this got created.... There's more context in the linked comment thread. Off

Open freaki7 opened this issue 2 years ago • 0 comments

I am unsure what happened that this got created.... There's more context in the linked comment thread.

Essentially I'm trying to access an identity token for a service account, but getIdToken() is returning undefined. Here's how I'm creating my service:

function getOAuthService(user) {
  const properties = PropertiesService.getScriptProperties();
  const private_key = properties.getProperty("private_key").replace(/\\n/g, "\n");
  const client_email = properties.getProperty("client_email");

  return OAuth2.createService('Service Account')
    .setTokenUrl('https://accounts.google.com/o/oauth2/token')
    .setPrivateKey(private_key)
    .setIssuer(client_email)
    .setScope('openid');
}

Originally posted by @biowalker in https://github.com/googleworkspace/apps-script-oauth2/issues/411#issuecomment-1290947624

freaki7 avatar Dec 05 '22 22:12 freaki7