How to make CalendarService object using access_token?

后端 未结 4 1124
我寻月下人不归
我寻月下人不归 2020-12-18 06:06

I am trying to use google calendar v3 api using .net client. I am follwing a hybrid approach. I have authorized my application using oauth2 using only http post request and

4条回答
  •  忘掉有多难
    2020-12-18 06:32

    The example you uses FileDataStore.

    How FileDataStore works - The first time you run the code it will ask the user if they want to let you access there calender. The information is then stored in your %appData% directory. If you want to load a refresh token that you have for example stored in the database you cant.

    Stored Refreshtoken - In order to use a refreshToken that you for example have stored in the database you need to create your own implimitation of IdataStore. Once you have done that you will be able to send the refresh token that you saved previously.

    This tutorial should help you understand http://www.daimto.com/google-oauth2-csharp/

    You dont need to deal with getting new access token the Service will use the RefreshTokens to get a new access token for you.

    If this doesnt help post a comment and i will see if i can expend it a little more.

提交回复
热议问题