How Google API V 3.0 .Net library and Google OAuth2 Handling refresh token

后端 未结 3 1637
迷失自我
迷失自我 2020-11-29 05:32

In my application I am using Google API V 3.0 .Net library with Google OAuth2 to synchronize Google calender and outlook calender. I am using below code to get the Google.Ap

3条回答
  •  鱼传尺愫
    2020-11-29 06:19

    That's the butty of the client library! this magic is done for you automatically :)

    UserCredential implements both IHttpExecuteInterceptor and IHttpUnsuccessfulResponseHandler. so whenever the access token is going to be expired, or is already expired, the client makes a call to the authorization server to refresh the token and get a new access token (which is valid for the next 60 minutes).

    Read more about it at https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#credentials

提交回复
热议问题