summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdWebRingSsoProvider/Default.aspx.cs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenIdWebRingSsoProvider/Default.aspx.cs')
-rw-r--r--samples/OpenIdWebRingSsoProvider/Default.aspx.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/samples/OpenIdWebRingSsoProvider/Default.aspx.cs b/samples/OpenIdWebRingSsoProvider/Default.aspx.cs
index a1ffeec..6a930bd 100644
--- a/samples/OpenIdWebRingSsoProvider/Default.aspx.cs
+++ b/samples/OpenIdWebRingSsoProvider/Default.aspx.cs
@@ -10,17 +10,23 @@
using OpenIdWebRingSsoProvider.Code;
public partial class _Default : System.Web.UI.Page {
- protected async void Page_Load(object sender, EventArgs e) {
- // The user may have just completed a login. If they're logged in, see if we can complete the OpenID login.
- if (User.Identity.IsAuthenticated && ProviderEndpoint.PendingAuthenticationRequest != null) {
- await Util.ProcessAuthenticationChallengeAsync(ProviderEndpoint.PendingAuthenticationRequest, Response.ClientDisconnectedToken);
- if (ProviderEndpoint.PendingAuthenticationRequest.IsAuthenticated.HasValue) {
- var providerEndpoint = new ProviderEndpoint();
- var responseMessage = await providerEndpoint.PrepareResponseAsync(this.Response.ClientDisconnectedToken);
- await responseMessage.SendAsync(new HttpContextWrapper(this.Context), this.Response.ClientDisconnectedToken);
- this.Context.Response.End();
- }
- }
+ protected void Page_Load(object sender, EventArgs e) {
+ this.RegisterAsyncTask(
+ new PageAsyncTask(
+ async ct => {
+ // The user may have just completed a login. If they're logged in, see if we can complete the OpenID login.
+ if (User.Identity.IsAuthenticated && ProviderEndpoint.PendingAuthenticationRequest != null) {
+ await
+ Util.ProcessAuthenticationChallengeAsync(
+ ProviderEndpoint.PendingAuthenticationRequest, Response.ClientDisconnectedToken);
+ if (ProviderEndpoint.PendingAuthenticationRequest.IsAuthenticated.HasValue) {
+ var providerEndpoint = new ProviderEndpoint();
+ var responseMessage = await providerEndpoint.PrepareResponseAsync(this.Response.ClientDisconnectedToken);
+ await responseMessage.SendAsync(new HttpContextWrapper(this.Context), this.Response.ClientDisconnectedToken);
+ this.Context.Response.End();
+ }
+ }
+ }));
}
}
}