PDA

View Full Version : oAuth2 and gmail



jceoms
6-Jan-2016, 06:40 AM
that operation must put in OAuth2 to receive Gmail messages?

Mike Peat
7-Jan-2016, 04:41 AM
Hi jceoms

The oAuth2 sample application (http://support.dataaccess.com/Forums/attachment.php?attachmentid=9277&d=1443020867) contains a Google API example (see its documentation (https://docs.google.com/document/d/14Kvk0C-vZXBrORh6IjlEzk63Z1KuYHQ3vL5CzpXHXmY/edit#heading=h.nyt1odf3kvvg) for how to use it). What you need to do is first register as a Google developer (https://developers.google.com/), then register your application with Google (in the Developer Console (https://console.developers.google.com)), which will involve such things as supplying a unique name for the app, a callback url (which can be based on "localhost" for development, but will need to be a proper, Internet-available IP address or DNS hostname, running on HTTPS, for deployment - don't worry for now: you can add new ones later) and a Logo to be displayed to users being asked to allow your app access to GMail. In return, you will get a "Client ID", which your app will use to identify itself to Google and a "Client Secret". (I see that the Google Developer Console has completely changed since I last visited it, so I can't be much help with this process: you'll just have to explore on your own, I'm afraid.)

Once you have done all that, the code in the oAuth2 Google sample should make it clear what else you need to do access the user's GMail messages. You can try this out in the sample app's "Google Test" view: enter "https://mail.google.com" as the "Scope", then click the "Login to Google" button, then enter "gmail/v1/users/me/messages" as the "Operation" with "GET" as the HTTP Verb, then click "Execute" - you should see the returned JSON (http://www.json.org/) list of messages in the "Response" edit box.

Mike

jceoms
7-Jan-2016, 05:24 AM
thank you, but I would like to see the message inbox...not a json format

FrankValcarcel
26-Mar-2016, 11:56 AM
oAuth2 sample SWS looks for a Sture library that is not included.

Mike Peat
27-Mar-2016, 06:37 AM
Frank

The workspace has a very minimal (all it needs) version of Sture's stuff in it (StureApsLibMin).

Mike