DotNetOpenAuth パッケージを使用しています。パッケージを Google ドキュメントにアップロードしようとしています。
クライアント資格情報を使用して、次のコードを使用して正常に実行できます。
DocumentEntry objDocumentEntry = new DocumentEntry();
objDocumentsService.setUserCredentials(strUserName,strPassWord);
string strAuthenticationToken =
objDocumentsService.QueryAuthenticationToken();
objDocumentEntry =
objDocumentsService.UploadDocument(Server.MapPath("test.docx"), "New
Name");
プレーンなoAuthで保存したいので、次のコードを書いています。
if (this.TokenManager != null)
{
if (!IsPostBack)
{
var google = new
WebConsumer(GoogleConsumer.ServiceDescription, this.TokenManager);
// Is Google calling back with authorization?
var accessTokenResponse =
google.ProcessUserAuthorization();
if (accessTokenResponse != null)
{
this.AccessToken =
accessTokenResponse.AccessToken;
}
else if (this.AccessToken == null)
{
// If we don't yet have access, immediately
request it.
GoogleConsumer.RequestAuthorization(google,
GoogleConsumer.Applications.DocumentsList);
}
}
}
「AccessToken」は取得できたのですが、使い方がよくわかりません。このトークンを交換する必要はありますか?このトークンをどうするのですか?それはsessionTokenですか?
いくつかの情報を提供してください。過去 3 日間、この問題に悩まされています。
プラシャント C