Sending mail with the java API: authorized sender address

42 views
Skip to first unread message

Renaud Tarnec

unread,
Dec 7, 2015, 4:39:06 PM12/7/15
to Google App Engine
Hi,

I am using Endpoints in a JavaScript Client, with authentication via OAuth 2.0. In other words I have added a parameter of type User to each class method which require authorization, e.g.:

@ApiMethod(name = "scores.insert")
public Score insert(Score score, User user) throws OAuthRequestException, IOException {
 
...
}

In one of my method I send a mail with the java API. This works fine with the sender address of the message being listed in the Cloud Platform Console under Email API Authorized Senders (see https://cloud.google.com/appengine/docs/java/mail/)

However the documentation says that:

"For security purposes, the sender address of a message must be one of the following:


What exactly does mean the FIRST bullet point: is it the gmail account of the end-user who is logged via OAuth? i.e. the user that is passed as a parameter to the method?

Thanks in advance!



Patrice (Cloud Platform Support)

unread,
Dec 9, 2015, 1:33:16 PM12/9/15
to Google App Engine
Hi Renaud,

If I understood your queston, yes you got it right. The first bullet point means that one of the possible senders can be the user who's currently Authenticated (via OAuth), or any of the other email that are mentioned afterwards.

Cheers!
Reply all
Reply to author
Forward
0 new messages