Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Implement oAuth PHP for the Gmail Atom feed?

Tags:

php

oauth

gmail

I want to use oAuth in PHP to access Gmail's atom feed. I am not sure where or how to start coding this... on Google's page it says this:

To obtain access, you can use AuthSub or OAuth by requesting a token with scope=https://mail.google.com/mail/feed/atom

How to do that in PHP? Thanks for helping a programming newbie :D

like image 614
01jayss Avatar asked Jan 18 '23 09:01

01jayss


1 Answers

See below URL it is very very use full for you with demo and source code. Read carefully

You can start with this example.

Get Unread Emails From Gmail Using Gmail Feed API, OAuth and PHP With Atom

http://lookmywebpage.com/api/google/get-unread-emails-from-gmail-using-gmail-feed-api-oauth-and-php/

At a basic level, the process is as follows:

  • Your application requests access and gets an unauthorized request token from Google’s authorization server.

  • Google asks the user to grant you access to the required data. If the user is not already logged in, Google prompts the user to log in. Google then displays an authorization page that allows the user to see what Google service data your application is requesting access to.

  • Your application gets an authorized request token from the authorization server. Each request token is valid for only one hour.

  • You exchange the authorized request token for an access token.

  • You use the access token to request data from Google’s service access servers. By default, access tokens are long-lived. Each access token is specific to the user account specified in the original request for authorization, and grants access only to the services specified in that request. Your application should store the access token securely, because it’s required for all access to a user’s data.

How to start?

How to start - see below url

http://lookmywebpage.com/api/google/get-unread-emails-from-gmail-using-gmail-feed-api-oauth-and-php/

like image 66
Abid Hussain Avatar answered Jan 29 '23 08:01

Abid Hussain