summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-06-16 19:50:28 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2008-06-16 19:50:28 -0700
commite1c75ebb2d9d0f22a8d76cc3d0ed187d5a603e28 (patch)
tree8424b884367e3ab9536f9935d539cf75dbccc884
parent5c1cd72bdb3a0df7608555ebde5008b35377f46c (diff)
downloadDotNetOpenAuth-e1c75ebb2d9d0f22a8d76cc3d0ed187d5a603e28.zip
DotNetOpenAuth-e1c75ebb2d9d0f22a8d76cc3d0ed187d5a603e28.tar.gz
DotNetOpenAuth-e1c75ebb2d9d0f22a8d76cc3d0ed187d5a603e28.tar.bz2
Updated ASP.NET MVC sample to Preview 3.
-rw-r--r--lib/System.Web.Abstractions.dllbin78840 -> 87032 bytes
-rw-r--r--lib/System.Web.Mvc.dllbin92152 -> 113144 bytes
-rw-r--r--lib/System.Web.Routing.dllbin62456 -> 70648 bytes
-rw-r--r--samples/RelyingPartyMvc/Controllers/HomeController.cs6
-rw-r--r--samples/RelyingPartyMvc/Controllers/UserController.cs30
-rw-r--r--samples/RelyingPartyMvc/Default.aspx10
-rw-r--r--samples/RelyingPartyMvc/Web.config6
7 files changed, 33 insertions, 19 deletions
diff --git a/lib/System.Web.Abstractions.dll b/lib/System.Web.Abstractions.dll
index 496443f..cd88be0 100644
--- a/lib/System.Web.Abstractions.dll
+++ b/lib/System.Web.Abstractions.dll
Binary files differ
diff --git a/lib/System.Web.Mvc.dll b/lib/System.Web.Mvc.dll
index f8dee14..598cf6f 100644
--- a/lib/System.Web.Mvc.dll
+++ b/lib/System.Web.Mvc.dll
Binary files differ
diff --git a/lib/System.Web.Routing.dll b/lib/System.Web.Routing.dll
index d93f863..98ce397 100644
--- a/lib/System.Web.Routing.dll
+++ b/lib/System.Web.Routing.dll
Binary files differ
diff --git a/samples/RelyingPartyMvc/Controllers/HomeController.cs b/samples/RelyingPartyMvc/Controllers/HomeController.cs
index 15ae689..65caae2 100644
--- a/samples/RelyingPartyMvc/Controllers/HomeController.cs
+++ b/samples/RelyingPartyMvc/Controllers/HomeController.cs
@@ -6,11 +6,11 @@ using System.Web.Mvc;
namespace RelyingPartyMvc.Controllers {
public class HomeController : Controller {
- public void Index() {
+ public ActionResult Index() {
Response.AppendHeader("X-XRDS-Location",
new Uri(Request.Url, Response.ApplyAppPathModifier("~/Home/xrds")).AbsoluteUri);
- RenderView("Index");
+ return View("Index");
}
- public void Xrds() { RenderView("Xrds"); }
+ public ActionResult Xrds() { return View("Xrds"); }
}
}
diff --git a/samples/RelyingPartyMvc/Controllers/UserController.cs b/samples/RelyingPartyMvc/Controllers/UserController.cs
index 991a4bd..35f6966 100644
--- a/samples/RelyingPartyMvc/Controllers/UserController.cs
+++ b/samples/RelyingPartyMvc/Controllers/UserController.cs
@@ -5,27 +5,34 @@ using System.Web;
using System.Web.Mvc;
using DotNetOpenId.RelyingParty;
using System.Web.Security;
+using DotNetOpenId;
namespace RelyingPartyMvc.Controllers {
public class UserController : Controller {
- public void Index() {
+ public ActionResult Index() {
if (!User.Identity.IsAuthenticated) Response.Redirect("/User/Login?ReturnUrl=Index");
- RenderView("Index");
+ return View("Index");
}
- public void Logout() {
+ public ActionResult Logout() {
FormsAuthentication.SignOut();
- Response.Redirect("/Home");
+ return Redirect("/Home");
}
- public void Login() {
+ public ActionResult Login() {
// Stage 1: display login form to user
- RenderView("Login");
+ return View("Login");
}
- public void Authenticate() {
+ public ActionResult Authenticate() {
var openid = new OpenIdRelyingParty();
if (openid.Response == null) {
// Stage 2: user submitting Identifier
- openid.CreateRequest(Request.Form["openid_identifier"]).RedirectToProvider();
+ Identifier id;
+ if (Identifier.TryParse(Request.Form["openid_identifier"], out id)) {
+ openid.CreateRequest(Request.Form["openid_identifier"]).RedirectToProvider();
+ } else {
+ ViewData["Message"] = "Invalid identifier";
+ return View("Login");
+ }
} else {
// Stage 3: OpenID Provider sending assertion response
switch (openid.Response.Status) {
@@ -34,14 +41,13 @@ namespace RelyingPartyMvc.Controllers {
break;
case AuthenticationStatus.Canceled:
ViewData["Message"] = "Canceled at provider";
- RenderView("Login");
- break;
+ return View("Login");
case AuthenticationStatus.Failed:
ViewData["Message"] = openid.Response.Exception.Message;
- RenderView("Login");
- break;
+ return View("Login");
}
}
+ return new EmptyResult();
}
}
}
diff --git a/samples/RelyingPartyMvc/Default.aspx b/samples/RelyingPartyMvc/Default.aspx
index c44a95d..1f81ae3 100644
--- a/samples/RelyingPartyMvc/Default.aspx
+++ b/samples/RelyingPartyMvc/Default.aspx
@@ -1 +1,9 @@
-<!-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --> \ No newline at end of file
+<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e) {
+ Response.Redirect("~/Home/Index");
+ }
+</script>
+
+<!-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. -->
diff --git a/samples/RelyingPartyMvc/Web.config b/samples/RelyingPartyMvc/Web.config
index c865def..9ae9435 100644
--- a/samples/RelyingPartyMvc/Web.config
+++ b/samples/RelyingPartyMvc/Web.config
@@ -34,8 +34,8 @@
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+ <add assembly="System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+ <add assembly="System.Web.Routing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
@@ -81,7 +81,7 @@
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+ <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>