仕事
個人活動
http://bit.ly/metrotokyo4
http://tech.tanaka733.net
http://okazuki.hatenablog.com/entry/2014/04/21/003008
WebAuthenticationBroker.GetCurrentApplicationCallbackUri()
protected async override void OnActivated(IActivatedEventArgs e)
{
//前半略
var continuationEventArgs = e as IContinuationActivatedEventArgs;
if (continuationEventArgs != null)
{
var page = rootFrame.Content as TwitterPage;
if (page != null)
{
page.ContinueWebAuthentication(e
as WebAuthenticationBrokerContinuationEventArgs);
}
}
Window.Current.Activate();
}
//パラメーターを生成
var options = new List<KeyValuePair<string, string>>(capacity: 1)
{
new KeyValuePair<string,string>("oauth_callback", callbackUri)
};
var headerParams = OAuthUtility.BuildBasicParameters("vPJVb79KWRIaTFAZ3ri5KY0cF",
"p1XJIHjnkvIF7zscQDOL1La4KpKfPNRTuvwIzSHDwtkv5YwtYe",
"https://api.twitter.com/oauth/access_token",
System.Net.Http.HttpMethod.Post,
new RequestToken(token, ""),
options);
var header = headerParams.Select(p => p.Key + "=" + p.Value.Wrap("¥"")).ToString(",");
//AccessTokenを取得
var client = new HttpClient();
var request = new HttpRequestMessage(
HttpMethod.Post,
"https://api.twitter.com/oauth/access_token")
{
Content = new FormUrlEncodedContent
(new List<KeyValuePair<string, string>>(capacity: 1)
{
new KeyValuePair<string,string>("oauth_verifier", verifier)
})};
request.Headers.Authorization = new AuthenticationHeaderValue("OAuth", header);
var response = await client.SendAsync(request);
using
OneMoreThing…
http://www.microsoft.com/ja-jp/events/developer/default.aspx
20140510 Twitter Authentication by WebAuthentictionBroker in Windows Phone 8.1 with AsyncOAuth

20140510 Twitter Authentication by WebAuthentictionBroker in Windows Phone 8.1 with AsyncOAuth