diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-23 09:01:13 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-23 09:01:13 -0700 |
commit | a46f18685f6ab0b843a9de63bf0172ad22808033 (patch) | |
tree | 08dfd9ee709549327c108fa4883182725777a7dc /samples/OpenIdProviderMvc/Controllers/UserController.cs | |
parent | 7323ea7a7b17e6fc0c6636f4c5784d5bfe2179e9 (diff) | |
download | DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.zip DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.tar.gz DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.tar.bz2 |
Shorted anonymous identifier hash length, reworked the OP MVC sample to support both anonymous and identifying identifiers.
Diffstat (limited to 'samples/OpenIdProviderMvc/Controllers/UserController.cs')
-rw-r--r-- | samples/OpenIdProviderMvc/Controllers/UserController.cs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/samples/OpenIdProviderMvc/Controllers/UserController.cs b/samples/OpenIdProviderMvc/Controllers/UserController.cs index 0a5b04e..c160fce 100644 --- a/samples/OpenIdProviderMvc/Controllers/UserController.cs +++ b/samples/OpenIdProviderMvc/Controllers/UserController.cs @@ -7,19 +7,25 @@ namespace OpenIdProviderMvc.Controllers { using System.Web.Mvc.Ajax; public class UserController : Controller { + public ActionResult PpidIdentity() { + if (Request.AcceptTypes.Contains("application/xrds+xml")) { + return View("PpidXrds"); + } + + return View(); + } + public ActionResult Identity(string id) { - if (!string.IsNullOrEmpty(id)) { - var redirect = this.RedirectIfNotNormalizedRequestUri(); - if (redirect != null) { - return redirect; - } + var redirect = this.RedirectIfNotNormalizedRequestUri(); + if (redirect != null) { + return redirect; } if (Request.AcceptTypes.Contains("application/xrds+xml")) { return View("Xrds"); } - this.ViewData["username"] = string.IsNullOrEmpty(id) ? "anonymous" : id; + this.ViewData["username"] = id; return View(); } @@ -27,6 +33,10 @@ namespace OpenIdProviderMvc.Controllers { return View(); } + public ActionResult PpidXrds() { + return View(); + } + private ActionResult RedirectIfNotNormalizedRequestUri() { Uri normalized = Models.User.GetNormalizedClaimedIdentifier(Request.Url); if (Request.Url != normalized) { |