We use Google Workspace for our email and want to set up ERPNext outgoing email via OAuth / service principal as app passwords are quite rightly discontinued.
When trying to create the Connected App on the ERPNext side, we get the following error which I think speaks for itself:
Is this our error or a bug and what can we do about it, is it an arbitrary limit or deep in the system? 140 characters in a URL as of 2025 seems really short and not scalable.
Thanks; I did this and it worked. I’ll create a GitHub issue.
Now I have another issue. We’re currently sending outgoing mail with Google Workspace SMTP Relay with authentication off (limited by IP addresses). But I’m wondering now if what I want to do will even work as Google Workspace seems to use JWT, not OAuth for service accounts / domain-wide delegation. Is there a way to get ERPNext to work with Google Workspace for sending outgoing mail without linking to any specific user? (I also have admin on Google Workspace / Cloud.)
I then tried setting OAuth up anyway with my personal company email account, just to see if that would work. I was able to set up the OAuth Connected App and authenticate with “Connect to…”.
But when I went back to Email Account, enabled SMTP authentication, and chose OAuth with this connected app, I got the following message:
Please check your email login credentials. smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. For more information, go to\n5.7.8 https://support.google.com/mail/?p=BadCredentials 98e67ed59e1d1-3039f8b28acsm500967a91.10 - gsmtp')
What might I be doing wrong? ERPNext shouldn’t be sending a username and password.