Closed GoogleCodeExporter closed 9 years ago
Which sample does use this syntax? Can you show me the URL? The
AuthenticatorFactory has also been removed in one of the latest changes; the
service constructor now takes the Authenticator.
Original comment by mlin...@google.com
on 11 Aug 2011 at 3:04
The problem I'm encountering is in red highlights. One thing I'm sure about
this is I downloaded the outdated library, but that's what on the download
link. If you could provide or send a link of the latest version of dlls it
would be better.
Here is the link --> http://code.google.com/apis/tasks/v1/using.html
using System;
using System.Diagnostics;
using DotNetOpenAuth.OAuth2;
using Google.Apis.Authentication;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Authentication.OAuth2.DotNetOpenAuth;
using Google.Apis.Tasks.v1;
using Google.Apis.Tasks.v1.Data;
using Google.Apis.Util;
...
public static void Main(string[] args)
{
// Register the authenticator. The Client ID and secret have to be
copied from the API Access
// tab on the Google APIs Console.
var provider = new NativeApplicationClient(GoogleAuthenticationServer.
Description);
provider.ClientIdentifier = "YOUR_CLIENT_ID";
provider.ClientSecret = "YOUR_CLIENT_SECRET";
*AuthenticatorFactory.GetInstance().RegisterAuthenticator(() => new
OAuth2Authenticator(provider, GetAuthentication));*
// Create the service. This will automatically call the previously
registered authenticator.
var service = new TasksService();
...
}
private static IAuthorizationState GetAuthentication(
NativeApplicationClient arg)
{
// Get the auth URL:
IAuthorizationState state = new AuthorizationState(new[] {
TasksService.Scopes.Tasks.GetStringValue() });
state.Callback = new Uri(NativeApplicationClient.OutOfBandCallbackUrl
);
Uri authUri = arg.RequestUserAuthorization(state);
// Request authorization from the user (by opening a browser window):
Process.Start(authUri.ToString());
Console.Write(" Authorization Code: ");
string authCode = Console.ReadLine();
Console.WriteLine();
// Retrieve the access token by using the authorization code:
return arg.ProcessUserAuthorization(authCode, state);
}
Original comment by kulashak...@gmail.com
on 11 Aug 2011 at 7:30
Thanks for pointing out that issue. The documentation there is indeed
out-dated. For the moment you can stick with the samples which can be found at:
http://code.google.com/p/google-api-dotnet-client/wiki/APILibraries#Tasks_API
Original comment by mlin...@google.com
on 11 Aug 2011 at 7:52
Thanks for your respond as I am waiting for it. I have a question, I'm
planning to use REST instead of the library. I will use it using
HttpWebRequest what I wanna know is do you have samples for this? I'm hoping
that you can provide one.
On Thu, Aug 11, 2011 at 12:53 PM,
<google-api-dotnet-client@googlecode.com>wrote:
Original comment by kulashak...@gmail.com
on 11 Aug 2011 at 7:58
The links you mentioned doesn't have the dlls, only links
On Thu, Aug 11, 2011 at 12:57 PM, Christopher R. Valencia <
kulashaker30@gmail.com> wrote:
Original comment by kulashak...@gmail.com
on 11 Aug 2011 at 8:22
Sorry, try again. The links should work now.
Original comment by mlin...@google.com
on 11 Aug 2011 at 10:01
Original comment by mlin...@google.com
on 12 Aug 2011 at 12:54
Can you show me the working .dlls required the sample here -> *
http://code.google.com/p/google-api-dotnet-client/source/browse/Tasks.CreateTask
s/Program.cs?repo=samples
*
I already reference all the dlls from Binary folder and still can't find the
namespace --> (Google.Apis.Samples.Helper)
Original comment by kulashak...@gmail.com
on 14 Aug 2011 at 3:15
The Google.Apis.Samples.Helper is a project in the Sample solution:
http://code.google.com/p/google-api-dotnet-client/source/browse/?repo=samples#hg%2FSampleHelper
I would recommend downloading the entire Sample solution as a .zip, and
continuing from there:
http://contrib.google-api-dotnet-client.googlecode.com/hg/Current/Generated/ZipFiles/Samples.zip
Original comment by mlin...@google.com
on 15 Aug 2011 at 1:13
Original comment by mlin...@google.com
on 17 Aug 2011 at 8:25
AuthenticatorFactory.GetInstance().RegisterAuthenticator(
() => new OAuth2Authenticator(provider, GetAuthentication));
change this to
AuthenticatorFactory.GetInstance().RegisterAuthenticator(
() => new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthentication));
Original comment by afzalsha...@gmail.com
on 8 Jul 2012 at 11:03
yeah...this still doesn't work. You guys test this stuff before you post it or
what? It never calls the "GetAuthentication" method at all and therefore cannot
post. All i get is "login required" everytime I run this.
Original comment by tyler_wa...@jabil.com
on 9 Aug 2012 at 8:14
yeah...this still doesn't work. You guys test this stuff before you post it or
what? It never calls the "GetAuthentication" method at all and therefore cannot
post. All i get is "login required" everytime I run this.
did they fix it?
Original comment by pepe1...@gmail.com
on 8 Feb 2013 at 12:57
Yeah. The GetAuthentication method never gets called for me too.
Original comment by pradee...@gmail.com
on 4 Mar 2013 at 12:53
Trying to find the replacement code for the following lines:
AuthenticatorFactory.GetInstance().RegisterAuthenticator(
() => new OAuth2Authenticator(provider, GetAuthentication));
and
IAuthorizationState state = new AuthorizationState(new[] { CalendarService.Scopes.Calendar.GetStringValue() });
AuthenticatorFactor seems to be obsolete.
Original comment by ImStanVi...@gmail.com
on 18 Jun 2013 at 4:39
Original issue reported on code.google.com by
kulashak...@gmail.com
on 11 Aug 2011 at 9:00