apps-script-oauth2
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
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