I'm trying out my new SMTP library and trying to use it to send mail via Gmail. To do that, I need an OAuth2 access token. I've set up an OAuth2 client account in the Google API console, enabled the Gmail API and added the https://mail.google.com/
scope in the OAuth consent screen setup. Despite this, the POST request to https://accounts.google.com/o/oauth2/device/code returns the error
invalid_scope
. Switching the scope to email
makes the request go through. I tried two different HTTP clients to be sure this wasn't some freak encoding problem.
What am I doing wrong?