Access Google Apps Mail - gmail

I have to build an web-app for Google Apps market place where my app would enable Google Apps user to access and backup their Google Apps email to my server.
While I have a good knowledge with PHP and etc, with no prior knowledge to Google Apps development, I have been reading developers.google.com documentation since last couple of days and everything seems to start confusion with each-other now with SAML, Oauth2, OpenId, SSO etc, and Google Apps Mail and Gmail itself. So far, I have done helloworld app from the documentation that accesses the calendar and uses SSO for it.
I wish if you could point me to the right direction about how I should proceed to accessing the mail of the Google Apps user.

Since you wish to use the Google Apps Marketplace, you'll want to use 2-legged OAuth 1.0 with your application. OAuth 1.0 is officially deprecated but it's still the only supported authentication method to Google Accounts for the Marketplace.
Instructions for authenticating to Gmail IMAP via 2-legged OAuth 1.0 are available at:
https://developers.google.com/gmail/oauth_protocol

Seems like you are in the right place already - if you are going through the main developers.google.com documentation, that's where it should be.
I have had a look through their documentation, and found this though: Mail PHP API Overview
A quote from the above link/documentation:
App Engine applications can send email messages on behalf of the app's
administrators, and on behalf of users with Google Accounts. Apps can
receive email at various addresses. Apps send messages using the Mail
service and receive messages in the form of HTTP requests initiated by
App Engine and posted to the app.
More information:
Getting Started - Introduction - Google App Engine
Tutorial - Hello, World! - Google App Engine
Installing the PHP SDK - Google App Engine
EDIT
As I mentioned in the comments below, after further searching, I found this documentation for Google Data Apps APIs which should be helpful (the page currently 404s, but I've sent off a message to Google, so hopefully it should be fixed soon).
There is also a depreciated version of OAuth 1.0 that you could use to authenticate Gmail with IMAP/SMTP, using standard "three-legged" or non-standard "two-legged" OAuth.

Related

Web hook - get notified when my app is deleted from google third party apps

I have a Node JS app that uses google drive API to upload/import files.
The user have to provide permissions to my application in order to handle his files on his google drive.
When the user gives access to my app, it will appears on his third party apps on his google account.
After spending a lot of times scrolling in the google documentation, i couldn't find a solution for this problem:
How can my application receives a notification or a web hook request, when the user removes access to my application from his google account settings.
I hope that it's clear.
Thanks in advance.

How can i access Google APIs from NodeJS REST API?

I want to create a REST Api using NodeJS and make a request to some google apis(like gmail, contact and people api). I have created a project in google developer console and then enabled all necessary google apis in my project. Now when creating credentials(selected OAuth client ID), i am confused to choose the application type among 'Web application' and 'Others'. If i choose Web Application then what will be the value for Authorized JavaScript origins and Authorized redirect URIs
Note: I will be using this REST API for a chrome extension and an IOS app later.
https://developers.google.com/+/web/samples/javascript
states
"Note: Use a single project to hold all platform instances of your app (Android, iOS, web, etc.), each with a different Client ID."
Which means you would be fine selecting Web Application for your needs.

How to authenticate google api to insert calendar events - NodeJs

How can I authenticate my api access to insert new events to my google calendar without OAuth? I'm writing a node script without any front end/website and everywhere seems to recommend using OAuth with a redirect to your website...
The best solution I have come up with is write a secondary application purely to listen for that redirect and save the auth code returned.
Any suggestions would be greatly appreciated!
I think it was designed that OAuth be used to handle authentication and authorization when you're using Google APIs. You can read that from the Using OAuth 2.0 to Access Google APIs.
Google APIs use the OAuth 2.0 protocol for authentication and
authorization. Google supports common OAuth 2.0 scenarios such as
those for web server, installed, and client-side applications.
If you're using NodeJS for Calendar API, you can try the Node.js Quickstart. You'll be needing the following:
Node.js installed.
The npm package management tool (comes with Node.js).
Access to the internet and a web browser.
A Google account with Google Calendar enabled.

Google authentication for website using oAuth2.0

I'm new to the concept of maintaining user accounts in a website. I read from this Google developers page that Google provides an authentication and an authorization service. I'm only interested in maintaining accounts on my website that users can log into using their Google account username and password. I have an Express.js server.
I've spent hours reading about this online and stumbled upon one thing: the passport-google-oauth module can be used to do this. But I was unable to find how to get this working with the latest version of Express. Please help.
I would also like to know how to create a project on the Google Developers Console so that the users do not need Google+ accounts to use oauth2 (to get the Client id and secret).

Google API Service Account and nodejs

I want to be able to programmatically update a Youtube playlist using nodejs. In theory, this is possible using the Google API and jsonc.
As I want to do this without user interaction I have been battling with using a Google API Service Account on nodejs server.
Notice there is no API Client Library for Javascript listed on this page.
I then stumbled across this message in the Google documentation for using Service Accounts with Google Drive:
For security reasons service accounts are not supported in client-side Javascript. Service accounts for server-side Javascript is not yet supported.
Is this saying that what I want to achieve is not possible? I cannot use a Service Account on a NodeJS server to make changes to a playlist without user interaction?
Correct. Not yet supported. There have been security problems with service accounts. This may become possible in the future.
Since yet there is no integration via Javascript for security reasons , you maybe want to try implementing this library.
https://github.com/extrabacon/google-oauth-jwt

Resources