Google+ API: How can I use RefreshTokens to avoid requesting access every time my app launches?

前端 未结 5 1448
不知归路
不知归路 2020-12-02 08:45

I\'m trying to use the Google+ API to access info for the authenticated user. I\'ve copied some code from one of the samples, which works fine (below), however I\'m having t

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 09:50

    I would recommend looking at the "SampleHelper" project in the Samples solution of the Google .NET Client API:

    • Samples/SampleHelper/AuthorizationMgr.cs

    This file shows both how to use Windows Protected Data to store a Refresh token, and it also shows how to use a Local Loopback Server and different techniques to capture the Access code instead of having the user enter it manually.

    One of the samples in the library which use this method of authorization can be found below:

    • Samples/Tasks.CreateTasks/Program.cs

提交回复
热议问题