How do I call the gmail api in Spring Boot 2.x using a service account?
I have a GSuite service account configured to access corporate user gmail accounts, I have provided it with all of the privileges in the G Suite Admin console including Domain Wide access. I create a service account and now want to use the credentials to send emails on their behalf. Here is my code so far: public void gmailTest(){ log.info("Gmail test"); List<String> SCOPES = new ArrayList<String>(GmailScopes.all()); // List<String> SCOPES = GmailScopes.all(); InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("Program Name-12345678.json"); try {