Google Account Information with oauth - php

I am develop a application that allow login from other applications, eg. Google, Facebook, linkedin, etc.
My question is, howto obtain the user account information from google, after login with oauth.
With user account information, i mean: name, email, date of birth, etc.
Thanks.

If you're talking about Google Apps, there's a lot of info on the APIs on Google Code: http://code.google.com/googleapps/docs/#auth
If you're just using Open ID with Google Accounts, I believe you can only get name + email address. There's some info (including code samples) in the Google Apps Marketplace docs: http://code.google.com/googleapps/marketplace/tutorial_php.html#Integrate-OpenID

Related

Pull a user's Google+ or Gmail list of contacts and their email addresses

I'm building an app in which I'm trying to allow a user to log in through Google+ (currently using the Google API PHP Client Library) and pull their entire contact list in to decide if they want to send an email to their list from my app. I can easily see how to allow the user to grant access to multiple permissions through different Google APIs through setting scopes.
I'm struggling to see either what scope I should be setting when making a request and/or what API should accomplish pulling a logged in user's contact list along with each contact's email address.
Any help would be greatly appreciated.
I found the answer, you have to pull contacts with an valid OAuth request through the Google Contacts API. On the documentation page for the Google Contacts API, Google says:
The Google Contacts API allows client applications to view and update a user's contacts. Contacts are stored in the user's Google Account; most Google services have access to the contact list.
You can find the documentation here.
https://developers.google.com/google-apps/contacts/v3/

How can I export my friends' contact information from GMail, Yahoo, and Facebook using PHP?

How can I export my friends' contact information (name, email, etc.) from GMail, Yahoo, and Facebook using PHP?
You need to learn about API access through each of these applications before you can even begin to grab the data. I suggest you Google on acquiring contacts for each of them. I'll help you get started though with a few links: https://developers.google.com/ http://developers.facebook.com/ http://developer.yahoo.com/. If you read up on each of those you should be more than capable of acquiring the information you seek. Just remember that if you plan to get a person who is not you give up this information they need to approve the connection to you through each API.

logining via 3-party sites: what to use oauth or openid

I need to develop a service that will perform login through several login providers (google, facebook, twitter and yahoo). Besides, I'll need to grab data from users profile (login, email, birhday and etc). Still I can't catch: is it better to use OAuth or OpenID (where it's posible) for that.
Thank you in advance!
If your requirement is to let users to login using various providers such as google, facebook etc and if you only need to grab profile information such as email, full name, county, language etc, Then OpenID is the best and the simple way to do it. That is the widely seeing use case of OpenID.
But if you are willing to interact with those providers such as to post in user's facebook wall etc, then go for OAuth. OAuth allows you to perform operations on those providers on behalf of the user.

Can I use OAuth (and not other services) to fetch the user's picture, gender, location and email address from google?

I'm currently using the following API :
http://www-opensocial.googleusercontent.com/api/people/#me/#self
and scope is:
http://www-opensocial.googleusercontent.com/api/people/
Here is a list of all Services, that Google provides access to via OAuth:
http://code.google.com/apis/gdata/docs/directory.html
You could use the Google Apps Api from there, if all your users have Google Apps accounts.
But I guess they don't have.
Unfortunately I don't know of any other API, that provides access to the user himselfe, you can however use the contacts Api, which will provide you the information (gender, location, email, ...) about the users contacts..

How do I invite people from MSN, Yahoo into my application?

I need to add an invite users functionality to my social networking application so users can invite contacts from their hotmail or yahoo accounts. How do I do this and are there any free open source libraries that do this?
Depending on the service you wish to get the contact information from they might already provide a published API for you.
For example, Yahoo has a contact list API you could use: http://developer.yahoo.com/social/rest_api_guide/contact_api.html
Google also has one: http://code.google.com/apis/contacts/
And so does Windows Live: http://msdn.microsoft.com/en-us/library/bb463974.aspx
If you need something to work with a service without an API then you might have to ask that user for his username and password, use it temporarily to log into his account, download the contact information and then discard the login details. There are obvious privacy and security issues with this approach, however. Nevertheless, it is used quite frequently by many social networking sites.
The same approach can also be used to retrieve buddy information from instant messaging services. You log in (perhaps using an open source IM API) and get their buddy list and contact details.
Just in case anyone was interested - I would like to share this neat piece of code I found off the web. Its free and very easy to setup and integrate. http://openinviter.com is php based and you can extract email contacts from just about any address book there is.
You just need to have curl set up for this.

Categories