summaryrefslogtreecommitdiffstats
path: root/samples/RelyingPartyMvc/Controllers/UserController.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-03-09 15:07:13 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-03-11 21:15:52 -0700
commit9b18e10a4e4ec4baa33097ed4c90a233094ce86c (patch)
treec5eed29f2db3a95a48815dc2db07856517b2ff83 /samples/RelyingPartyMvc/Controllers/UserController.cs
parent5048e8556ec74bc2cf6dc85a609d911c3a767e0a (diff)
downloadDotNetOpenAuth-9b18e10a4e4ec4baa33097ed4c90a233094ce86c.zip
DotNetOpenAuth-9b18e10a4e4ec4baa33097ed4c90a233094ce86c.tar.gz
DotNetOpenAuth-9b18e10a4e4ec4baa33097ed4c90a233094ce86c.tar.bz2
Added preliminary version of a popup login box sample.
Diffstat (limited to 'samples/RelyingPartyMvc/Controllers/UserController.cs')
-rw-r--r--samples/RelyingPartyMvc/Controllers/UserController.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/samples/RelyingPartyMvc/Controllers/UserController.cs b/samples/RelyingPartyMvc/Controllers/UserController.cs
index c6b8479..bebdaa5 100644
--- a/samples/RelyingPartyMvc/Controllers/UserController.cs
+++ b/samples/RelyingPartyMvc/Controllers/UserController.cs
@@ -5,6 +5,7 @@
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
+ using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.RelyingParty;
@@ -17,6 +18,10 @@
return View("Index");
}
+ public ActionResult LoginPopup() {
+ return View("LoginPopup");
+ }
+
public ActionResult Logout() {
FormsAuthentication.SignOut();
return Redirect("/Home");
@@ -34,7 +39,12 @@
// Stage 2: user submitting Identifier
Identifier id;
if (Identifier.TryParse(Request.Form["openid_identifier"], out id)) {
- openid.CreateRequest(Request.Form["openid_identifier"]).RedirectToProvider();
+ try {
+ openid.CreateRequest(Request.Form["openid_identifier"]).RedirectToProvider();
+ } catch (ProtocolException ex) {
+ ViewData["Message"] = ex.Message;
+ return View("Login");
+ }
} else {
ViewData["Message"] = "Invalid identifier";
return View("Login");