token em vbnet incluido no header da requisição
Const client_id = "XXXX.apps.googleusercontent.com"
Const client_secret = "XXXXXXXXXXX"
Const refresh_token = "XXXXXXXXXX"
Const nome_aplicacao = "MinhaAplicacao"
Const user_id = "[email protected]"
Private Function CriaContactRequest(Optional scope As String = "https://www.google.com/m8/feeds https://www.google.com/m8/feeds/groups/default/full") As ContactsRequest
Try
Dim rs = New RequestSettings(nome_aplicacao) With { _
.OAuth2Parameters = New OAuth2Parameters() With { _
.AccessToken = refresh_token, _
.RefreshToken = refresh_token, _
.ClientId = client_id, _
.ClientSecret = client_secret, _
.RedirectUri = redirect_uri, _
.Scope = scope _
} _
}
Dim cr As New ContactsRequest(rs)
Return cr
Catch ex As Exception
Throw ex
End Try
End Function