summaryrefslogtreecommitdiffstats
path: root/samples/OAuthClient/GoogleApps2Legged.aspx.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-02-19 16:21:25 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-02-19 16:21:25 -0800
commit6d037a420c0d304bb2edeee17dce1b11db60b2bf (patch)
tree1a771e79f7fd4f04d4522e7fc6f8045d87a88572 /samples/OAuthClient/GoogleApps2Legged.aspx.cs
parent32270c7413e7a2c37a02341a0894e2447f6d74f7 (diff)
downloadDotNetOpenAuth-6d037a420c0d304bb2edeee17dce1b11db60b2bf.zip
DotNetOpenAuth-6d037a420c0d304bb2edeee17dce1b11db60b2bf.tar.gz
DotNetOpenAuth-6d037a420c0d304bb2edeee17dce1b11db60b2bf.tar.bz2
Removes OAuth 1 samples from the OAuth 2 site.
Diffstat (limited to 'samples/OAuthClient/GoogleApps2Legged.aspx.cs')
-rw-r--r--samples/OAuthClient/GoogleApps2Legged.aspx.cs42
1 files changed, 0 insertions, 42 deletions
diff --git a/samples/OAuthClient/GoogleApps2Legged.aspx.cs b/samples/OAuthClient/GoogleApps2Legged.aspx.cs
deleted file mode 100644
index fb39d40..0000000
--- a/samples/OAuthClient/GoogleApps2Legged.aspx.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-namespace OAuthConsumer {
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using DotNetOpenAuth.ApplicationBlock;
- using DotNetOpenAuth.Messaging;
- using DotNetOpenAuth.OAuth;
- using DotNetOpenAuth.OAuth.Messages;
-
- public partial class GoogleApps2Legged : System.Web.UI.Page {
- private InMemoryTokenManager TokenManager {
- get {
- var tokenManager = (InMemoryTokenManager)Application["GoogleTokenManager"];
- if (tokenManager == null) {
- string consumerKey = ConfigurationManager.AppSettings["googleConsumerKey"];
- string consumerSecret = ConfigurationManager.AppSettings["googleConsumerSecret"];
- if (!string.IsNullOrEmpty(consumerKey)) {
- tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
- Application["GoogleTokenManager"] = tokenManager;
- }
- }
-
- return tokenManager;
- }
- }
-
- protected async void Page_Load(object sender, EventArgs e) {
- var google = new WebConsumer(GoogleConsumer.ServiceDescription, this.TokenManager);
- string accessToken = await google.RequestNewClientAccountAsync(cancellationToken: Response.ClientDisconnectedToken);
- ////string tokenSecret = google.TokenManager.GetTokenSecret(accessToken);
- MessageReceivingEndpoint ep = null; // set up your authorized call here.
- var request = await google.PrepareAuthorizedRequestAsync(ep, accessToken, Response.ClientDisconnectedToken);
- using (var httpClient = google.Channel.HostFactories.CreateHttpClient()) {
- await httpClient.SendAsync(request, Response.ClientDisconnectedToken);
- }
- }
- }
-} \ No newline at end of file