Google Authentication Process

≯℡__Kan透↙ 提交于 2019-12-05 14:50:57
mammo

The example code is broken. To make the service use your authenticator, you need to connect it. In the example there is no association between the service and the authenticator. Create the service like this:

var service = new CalendarService(new BaseClientService.Initializer()
{
    Authenticator = auth
};

Look at https://code.google.com/p/google-api-dotnet-client/ for better documentation/working code.

bossylobster

Check out the new docs. You'll need to replace

var auth = new OAuth2Authenticator<NativeApplicationClient>(
    provider, (p) => GetAuthorization(provider));

with

AuthenticatorFactory.GetInstance().RegisterAuthenticator(
    () => new OAuth2Authenticator(provider, GetAuthentication));

As the comment says, when you call var service = new CalendarService(), the previously registered authenticator will automatically be called.

I think the above ways are related to old version of Google calendar DLL. Does any one know about the documentation of new version of Google calendar i.e. V 1.8.1.82. Google never provides the good documentation for .NET developer.s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!