Spencer-Easton / Apps-Script-Domain-Email-Signatures

A sample script to show how to set the signature block of a member of your domain
MIT License
3 stars 2 forks source link

with the v21 apps-script-oauth2 seems not working anymore #3

Closed Giorj73 closed 7 years ago

Giorj73 commented 7 years ago

Hi I started to have some errors on my webapp that is using the apps-script-oauth2 with part of the code from your code, but because the deprecation of .setPorjectKey('xxx') I switch to v21 and is not working anymore now I have Authorization is required to perform that action. Access not granted or expired. (line 352, file "Service", project "OAuth2")

Spencer-Easton commented 7 years ago

This method has been depreciated by google. https://apps-apis.google.com/a/feeds/emailsettings/2.0/

Use the Gmail api to set signatures. https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs/patch

Giorj73 commented 7 years ago

Yes but now the scopes are two Should I set instead . setScope('https://apps-apis.google.com/a/feeds/emailsettings/2.0/')

.setScope('https://www.googleapis.com/auth/gmail.settings.basic https://www.googleapis.com/auth/gmail.settings.sharing')

Same error (changed also under the security panel in the console)

Spencer-Easton commented 7 years ago

OK sorry I'll be more explicit. I'm not updating this repo as this method shouldn't be used any more. If you have an issue with the OAuth2 library that is maintained at: https://github.com/googlesamples/apps-script-oauth2

Giorj73 commented 7 years ago

fyi I just switch to a Service Account, and is working again