JavaMail oauth requires full mail scope for sending email via gmail

Viewed 112

JavaMail oauth requires full mail scope for sending email via gmail.

Used scope "https://www.googleapis.com/auth/gmail.send" for authorization. then get refresh and access token.

Java mail:

transport.connect(host, port, username, access_token);

Got error:

Oauth asks for more

After changing scope to "https://mail.google.com/" for authorization, it works. But this scope will authorize

send, read, delete all emails.

This scope is too much, no difference from password authentication.

0 Answers
Related