diff options
author | David Christiansen <coding@davedoes.net> | 2012-03-15 22:10:55 +0000 |
---|---|---|
committer | David Christiansen <coding@davedoes.net> | 2012-03-15 22:10:55 +0000 |
commit | a5bfa2bb8a614b1932ec8b7bbc6a0cc6bca3051f (patch) | |
tree | a3057157fa3287e0c0c4cc49be1854f9aa63d321 /src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs | |
parent | 02ce959db12fec57e846e5ebfa662cd0327ce69c (diff) | |
download | DotNetOpenAuth.Samples-a5bfa2bb8a614b1932ec8b7bbc6a0cc6bca3051f.zip DotNetOpenAuth.Samples-a5bfa2bb8a614b1932ec8b7bbc6a0cc6bca3051f.tar.gz DotNetOpenAuth.Samples-a5bfa2bb8a614b1932ec8b7bbc6a0cc6bca3051f.tar.bz2 |
W.I.P.
* Initial migration and reference to DNOA Nuget packages (From teamcity.dotnetopenauth.net)
* Awaiting fix to DotNetOpenAuth.OpenIdOAuth.nuspec in order to complete migration.
Diffstat (limited to 'src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs')
-rw-r--r-- | src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs b/src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs new file mode 100644 index 0000000..04b302c --- /dev/null +++ b/src/OAuth/OAuthClient/SignInWithTwitter.aspx.cs @@ -0,0 +1,39 @@ +namespace OAuthClient { + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using System.Web; + using System.Web.Security; + using System.Web.UI; + using System.Web.UI.WebControls; + using System.Xml.Linq; + using System.Xml.XPath; + using DotNetOpenAuth.ApplicationBlock; + using DotNetOpenAuth.OAuth; + + public partial class SignInWithTwitter : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + if (TwitterConsumer.IsTwitterConsumerConfigured) { + this.MultiView1.ActiveViewIndex = 1; + + if (!IsPostBack) { + string screenName; + int userId; + if (TwitterConsumer.TryFinishSignInWithTwitter(out screenName, out userId)) { + this.loggedInPanel.Visible = true; + this.loggedInName.Text = screenName; + + // In a real app, the Twitter username would likely be used + // to log the user into the application. + ////FormsAuthentication.RedirectFromLoginPage(screenName, false); + } + } + } + } + + protected void signInButton_Click(object sender, ImageClickEventArgs e) { + TwitterConsumer.StartSignInWithTwitter(this.forceLoginCheckbox.Checked).Send(); + } + } +}
\ No newline at end of file |