Access Google spreadsheets with OAuth 2.0 - oauth-2.0

I'm trying to access Google spreadsheets using gdata-python-2.0.17 library. In every tutorial, programmaticLogin(uname,pwd) is used but I feel it is not a good practice. I'm trying to overcome this by using OAuth 2.0 authentication(oauth2client.client).
I've managed up to granting access to a Google account by getting user consent.
I'm not sure whether the standard gdata.spreadsheet.service.SpreadsheetsService() can be used in this scenario.
According to this, it is not possible/easy to combine OAuth 2.0 and gdata-python library.
It's highly appreciated if someone know how to handle this with the said APIs or using later versions of Google API which can be used.
Thanks

Related

Access Google Drive API v3 with Ruby on Rails

I would like to access my Google Drive account via their API inside of a Rails application. The idea is that I will store files, but I don't believe I need to implement any authorisation for it (like with Oauth2, for example), since I only want to access my account.
I have been researching for 2 days, but the Google documentation seems very confused and not very clear.
I started in vain with this guide https://developers.google.com/drive/api/v3/quickstart/ruby and tried to co-opt it for use inside of Rails, but since it relies on storing a token file returned upon authentication, I figured this wasn't really the right approach.
I don't have any code to share, just looking for some clarity on how I can achieve what I'm trying to do, or indeed if it's even possible.
Additional Info:
I'm using Devise for my own authentication, so implementing omniauth through that would be an option if it's necessary. I looked through some documentation around that which Devise has on their side, but I didn't want to go through that (it seemed like a lot) before knowing it was the correct course of action.
You need OAuth 2.0 to authorize requests on the Drive API as described on the documentation. In that link, you can find: «All requests to the Drive API must be authorized by an authenticated user».
To complete that authorization process, you should follow the instructions on the Drive API Ruby Quickstart linked on your question. Generating and saving a credentials.json for later use is the normal approach in this situation. Here you can read about using OAuth 2.0 over different scenarios.
I hope to have cleared your doubts on this topic, but feel free to ask further questions.

Examples using updated gdata-java-client with Oauth2?

According to http://code.google.com/p/gdata-java-client/source/detail?r=505 the gdata-java-client library has recently (April 2012) been updated with OAuth2.0 support. I'd love to use that in a web application, to create and modify google spreadsheets. I want users of my web app to have their data stored in a google spreadsheet under their own credentials.
I'm new to using google apis, and am getting quite lost while trying to wade through examples. They all seem to refer to deprecated auth methods (oauth1 or authsub or clientlogin).
Has anyone seen any good, recent samples on how to use gdata apis with Oauth2.0 to accomplish the sort of thing I'm talking about? Thanks very much in advance. And sorry if the question is too n00by.

How can I use OAuth to replace OpenID for federated login

I am currently using OpenID as a relying-party to implement federated login on a website I'm developing. However cursory Google searches indicate that OpenID does not play well with web-services which I'd like to expose. However every tutorial, explanation or library seems oriented towards gaining access to a resource held by a 3rd party, Flickr library, Gmail address-book etc. Is it possible to use OAuth for this or am I barking up the wrong tree?
OAuth is not an appropriate technology to use here.

Does Google Documents List API support OAuth 2

The documentation currently does not mention OAuth 2. However, I was hoping the docs are out date, and that someone has gotten OAuth 2 to work with the Document List API. Even the Spreadsheet API supports it, so I'm having wishful thinking.
Turns out that support is in beta. Use scope=https://docs.google.com/feeds/

Can you use Google's oAuth to just authenticate?

Can you use oAuth to only authenticate like you can with Twitter?
If you check Google's docs at http://code.google.com/apis/accounts/docs/OAuth2.html you'll find that the scope (meaning, the service you're supposed to ask permission to) is a required field.
It may be a turn off for many users if you ask them to access their contact list when the most you really do is authenticate, so I rather stick with OpenID which is designed just to retrieve the UID.
So, the answer is really NO, unless you're planning on using an additional API with Google.
OAuth is an authorization protocol and can't be used for authentication only unless the provider defines a dummy scope which, in effect, authorizes you to access "nothing", or "basic user info" (name, e-mail, etc.).
AFAIK, Google provides no such "dummy" scope. However, they do implement OpenID for such authentication purposes, as the protocol is better suited for that task, anyways.
Yes you can there are many options it depens on your platform advice you to check
oauth.net
You can find there options for Java, .NET, Cold Fusion,PHP,etc.
There are many Frameworks that have OAuth capabilities, on Spring you can use this
Sounds like there is some plans afoot on this...
http://googlecode.blogspot.com/2011/03/making-auth-easier-oauth-20-for-google.html?showComment=1300267218233#c6336940633709651714
some chap:
"Can someone help by pointing to the documentation for the API of "just get basic information for a user"
other chap:
"The problem is, that you get a lot of different login mechanisms because Twitter is using OAuth 1.0 (Or am I wrong?), Facebook is using OAuth 2.0 and Google is using OpenID for login. Please correct me if I´m wrong. So basically I have the same question.
Will Google support login for basic user informations with OAuth 2.0 for Google APIs?"
google dude:
"Today we're supporting OpenID for login, but we've heard your pain about mess of different identity protocols on the web. Stay tuned :)"
Seems to me, as OAuth2 covers authentication and authorization, it would make sense to allow basic info and make it easy on the integrator using one method for all
I'm plumping for this possibility anyway, hopefully by the time I'm ready to put my app live it will be available from Google - Facebook has this anyway and in my case that's a big enough draw

Resources