0
我成功地得到,當我使用下面的代碼聯繫人:Google Contacts API:如何重用授權碼?
Dim parameters = New OAuth2Parameters()
parameters.ClientId = "XXX.apps.googleusercontent.com"
parameters.ClientSecret = "XXXX"
parameters.RedirectUri = "urn:ietf:wg:oauth:2.0:oob"
parameters.Scope = "https://www.google.com/m8/feeds"
Dim authorizationUrl As String = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters)
Process.Start(authorizationUrl)
Dim authCode As String = InputBox("Authorisation code", "Authorisation Code", "")
parameters.AccessCode = authCode
OAuthUtil.GetAccessToken(parameters)
Dim accessToken = parameters.AccessToken
Dim settings = New RequestSettings("my app name")
Dim cr = New ContactsRequest(settings)
Dim contcts = cr.GetContacts()
我的問題是:
我如何能以某種方式在會話中保持的授權,所以我不需要詢問用戶每幾個小時授權訪問他的聯繫人列表?