0

I would like to use the .NET client API to authenticate a user & authorize a web server application - using the Google.Apis.* packages from NuGet.

I had a look at the samples and have understood how the NativeApplicationClient and WebServerClient are used there. I had particular look at the "Tasks.ASP.NET.SimpleOAuth2" sample. But what I'm trying to achieve is to perform the authentication without any call to the Google service I want to ultimately use, whereas in the samples, the authentication is initially setup and "automatically" called upon the first request to the service.

Let's say my app would like to use Calendar. So I would like to use the SDK to:

  • generate the authentication URL (kind of OutgoingWebResponse) that I would pass to my client
  • validate the code and get the access token once I got the redirect

but without any actual call to the Calendar service at this step.

Any guidance would be greatly appreciated here. Thanks

ThomasWeiss
  • 1,292
  • 16
  • 30

1 Answers1

2

We are working hard on improving the OAuth2 flows. In only several weeks we are going to introduce a new (and definitely a better) way to authenticate. Meantime you can use the code in our repository (it's an open source project). Take a look at https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Auth/OAuth2/AuthorizationCodeFlow.cs and also https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Auth/OAuth2/GoogleAuthorizationCodeFlow.cs.

Release 1.6.0-beta will include those flows and will introduce UserCredential and ServiceAccountCredential. We are going to support WP, WinRT and MVC4 applications as well

peleyal
  • 3,472
  • 1
  • 14
  • 25
  • Thanks a lot for your answer. Any ETA for the availability of this 1.6.0 on Nuget? – ThomasWeiss Oct 04 '13 at 13:08
  • I don't know the exact date yet. I want to say it will take about 2-3 weeks, but I can't promise anything :) Meantime you can start using the code in the repository and even suggest improvements or report any problem you encounter. Thanks! – peleyal Oct 04 '13 at 14:45
  • By the way the new library is available to download using NuGet. Enjoy! – peleyal Nov 03 '13 at 15:21
  • Great! But why are your libraries systematically labeled as '-beta'? – ThomasWeiss Nov 05 '13 at 03:05
  • We are working on it. Anyway it's an open source project and all the code is available for you in our repository: https://code.google.com/p/google-api-dotnet-client/source/browse/ – peleyal Nov 06 '13 at 14:04