c# - Google authentication in portable class library -
i write portable application (windows store, windows phone, windows). use portable class library. see google make tasks api library (windows store, windows phone, windows). have problem google auth.
this code not work in portable library, (it's works on windows phone):
private observablecollection<string> _tasklisttitlescollection = new observablecollection<string>(); public observablecollection<string> tasklisttitlescollection { { return _tasklisttitlescollection; } set { _tasklisttitlescollection = value; } } public async void myfuncrion() { usercredential credential = await googlewebauthorizationbroker.authorizeasync( //new filestream("client_secrets.json", filemode.open, fileaccess.read), new clientsecrets { clientid = "", //"put_client_id_here", clientsecret = "" //"put_client_secrets_here" }, new[] { tasksservice.scope.tasks }, "user", cancellationtoken.none); var service = new tasksservice(new baseclientservice.initializer() { httpclientinitializer = credential, applicationname = "tasks api sample", }); tasklists results = await service.tasklists.list().executeasync(); foreach (var tasklist in results.items) { tasklisttitlescollection.add(tasklist.title + " " + tasklist.updated); // can data file (using file.title example) // , append textbox, list, etc. } }
- i want use library works tasks/books, want store usercredential in windows conteiner encryption(google store in app folder)
- how can crete
usercredential credential
myself, without set return valuegooglewebauthorizationbroker.authorizeasync
, have access code , want past here?
thanks!
Comments
Post a Comment