asifshaon / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

using refresh token in web applications #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which Google API and version (e.g. Google Tasks API version 1)?
Google Calendar V3

What should the sample demonstrate (e.g. using OAuth2, using a specific
feature of that API)?

I'm getting a refresh token for later use. Seems that this part is done and I'm 
collecting refresh tokens in a Web App.
The problem is how to use it in another page to authenticate the requests.

The purpose is to create an event, automatically, in Google Calendar when a 
user creates the same event in a internal tool (web based).

1- Users go to a web page and make the auth process to get the Refresh Token 
(stored for future offline use)

2- Using a internal tool (Web based) the users can administrate their Calendars 
and create new events. When saving the events the aplicattion must create the 
same events in the Google Calendar of the user (this must be transparent to the 
user)

Platform (e.g. Windows, Mono, Silverlight, WP7)?
Windows Vista, Visual Studio 2010

External references, such as API reference guide?
Using google-api-dotnet-client

I'm going nuts... please help me!

Original issue reported on code.google.com by ricardo....@gmail.com on 11 Apr 2012 at 1:41

GoogleCodeExporter commented 9 years ago
You will need to have a solid understanding of OAuth 2.0 in order to make this 
happen. Here is a good place to start: 
https://developers.google.com/accounts/docs/OAuth2

You can use a web UI in order to allocate and access the refresh tokens. The 
samples are using OAuth and the AuthorizationMgr class in the SampleHelper to 
"cache" the refresh token. When you have a refresh token, you can use it to get 
an access token. Once you have an access token, you can access the user's data. 
In the future, the library will support a new OAuth 2.0 feature, Service 
Accounts. That will allow you domain-wide access to user data (with sufficient 
access levels).

Original comment by asky...@google.com on 25 Apr 2012 at 5:48