Mobile apps server side programming (Accessing google calendar usingPHP) - php

I am trying to access google calendar from php program. I am using a php program as middle person to communicate with my android program and Goolge Calendar.
Google provided API to access calendar. when I try to access calendar it asks for authentication, then Login to google account, then Grant Access permision. My problem is I don't need multiple steps to access calendar. I will send Gmail ID and Password from android program to php by calling Calendar.php(For ex:), then php should receive that and directly login to Google Calcendar.

You cannot do this. Google uses OAuth for all it's 3rd party plugins, so the user has to go to a google page to authenticate, and then your app is given an OAuth key to use.
This is to stop you from maliciously storing the username and password given to your app and mis-using it.

Have you try the Canlendar.php demo from ZEND_GDATA which provided by google?
specially function 'outputCalendar'.that's the function to retrieve events from google calendar.
You can preview codes here
you should download demos somewhere and check yourself :)

Related

Open google calendar with auto login

Open google calendar with auto login
Requiremment: We want to facility to open a the google calendar with gmail id and pwd without the intervention of the user.So basically it will log out any other user if logged in to google and auto login with provided email and pwd and show the google calendar.
I have already tried following things,
1) Google calendar embed script: It does not log the user to the
google if already not logged in and uses which ever the logged in
users google calendar.
2) Google calendar API: The google service
API allows auto authenticate to specific google service account and
then we can fetch the events but this authentication does not
actually logs the user to google a/c so we cannot show the google
calendar.
3) Oauth2 authentication: This forces login but we cannot provide
email/pwd automatically here.
4) php curl login to google: I have
checked php curl login to google but it is not working and it is no
more supported (deprecated) by google.
ref:
Login to Google with PHP and Curl, Cookie turned off?
Is there any other option to achieve this.
This isn't going to be possible. Google won't allow it. Really, having to know a user's username and password is a bad idea security-wise anyway. Even if you had this, there are circumstances where it isn't going to work... two factor authentication for example.

Can I create a new ID Client Oauth without access to console?

I want to create a new Id Client Oauth 2.0 for Google Drive API, then generate the object JSON (oauth credentials), download it and place it in a specific folder, without the use of the console developers google. Is there a script (in php or javascript) that produce this with the email and password of a google account?
I want to create this "standalone script" because I dont want that the client must go before on the google console (although it will be for one-time).
thanks,
Matteo
It is not possible to programmatically create a project on Google developer console. The only way to create a new project is to do it though the website manually.
You are not going to find a script or anything to allow you to do this. The only think that remotely resembles this is the Google Cloud Resource Manager API but its not going to let you create credentials.

Sharing OAuth2 tokens between providers

I'm currently trying to wrap my head around a rather complex OAuth2 use case. I have two servers, one is a client side web server, which serves a website, the other is an API server, which is used to interface with all our backend data.
Currently users use a basic UserCredentials flow which creates an access token on our API server, which is then used to sign all requests from the webserver to the API
Is there a way I can allow users to log in using Google or Facebook, and either use the access token generated to sign API requests in the same way as above, or alternatively create an access token on our API which is then used the same way as above?
In a word: NO.
Let me try and explain why. Lets start by looking at Google, to access google you need to register your application in Google Apis console. When you ask a user to give you access to there google data you do it using the client id and secret you got from apis console. Then google goes about createing your application an access token for there api this info is all stored on there servers. When you then try and use that access token they know which user gave you access to there data via the api.
Now the same holds true for Facebook, and your service as well. They are all diffrent APIs offered by diffrent companys. They create the Access tokens Google cant create you an access token to access data on Facebook any more then Facebook could to Google. Things just dont work that way.

How authenticate a php website with google spreadsheet

I want to use Google Spreadsheets as a database when somebody fills out a form. Currently I have been able to use google spreadsheets with google account that does not have the two step authentication enabled. I did that with the Zend Framework.
I want to take it one step further and use the two step authentication so that even authenticated google account will also be able to store information in Google Spreadsheets.
I have a php website, how can I ask the user to authenticate and enable his website to access his spreadsheets and write in them.
I am seriously stuck. Any help will be much appreciated.
Sounds like you will need to use OAuth2 with Google Speadsheets API v3. This will allow users of your app to give it access to their Google docs.

How to make web application as Use Application-owned Accounts in server side google drive PHP

i wanna make web application use google drive sdk on PHP. when user login to my web using its own credential (ex username : lalala) will automatically login to user google account without user know like background login(silent mode) no redirect to google. username, email and password user save in mysql. user can upload file to google drive with my web application but not redirect to drive.google.com. how to make it? can someone give me an full example, please...
ClientLogin which implements basic authorization is deprecated across the Google products, you need to implement OAuth2 workflow for user accounts.

Categories