0

What is the solution to easily (I mean from the user point of view) get a token to connect into Google Calendar using the Google API? I'd like a user experience like my android device. At the installation, the application asks my login and password and never asks it again.

I should add/remove/update events of Google Calendar from a WPF desktop client application. I've found the Google API to manage this but the latest version seems to be a pain for the user. I should open a browser (or use the Browser control), ask the user to control and copy/paste the token received from Google.

I agree enter every time the password could be more secure but a password was asked to the user to connect into his/her Windows session and for the context of my application, it is secure enough.

JiBéDoublevé
  • 4,124
  • 4
  • 36
  • 57

1 Answers1

0

Using the new Google Apis (not GData) you can use OAuth2 to get permission from the user only once, as part of the return you will get a renew token then for each subsequent request if your session is expired you can renew session using the same renew token.

Yes you need to ask the user to copy and paste the authorization code from a web page once, and this is not the best user experience but is not that bad.

See my answer to a similar question.

The DotNet client for Google Apis.

A C# example using Google Apis in WPF with token refresh ( this is very pre-alpha). Look at getConfirmationCodeFromUser and GetAuthorization

It looks like the calendar is a new addition so get the calender dll from the repository until is is included in the full release. ( you will also need the library components)

Community
  • 1
  • 1
David Waters
  • 11,979
  • 7
  • 41
  • 76