summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-10-19 18:08:25 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-10-19 18:08:25 -0700
commit9fac617a455acffa4f78dc5cfe7415157e12a63c (patch)
tree47a4a7da8a8a61da203bb4f0714f179d1b572899
parentdab0acee2544e23f36b84b443af0d160adb4bc49 (diff)
downloadDotNetOpenAuth-9fac617a455acffa4f78dc5cfe7415157e12a63c.zip
DotNetOpenAuth-9fac617a455acffa4f78dc5cfe7415157e12a63c.tar.gz
DotNetOpenAuth-9fac617a455acffa4f78dc5cfe7415157e12a63c.tar.bz2
Moves all MVC dependencies from core assemblies to a separate assembly.
I still need to add DNOA.Mvc to some build and package authoring.
-rw-r--r--nuget/DotNetOpenAuth.Mvc.nuspec34
-rw-r--r--samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj4
-rw-r--r--samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj4
-rw-r--r--samples/OpenIdProviderMvc/OpenIdProviderMvc.csproj4
-rw-r--r--samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj4
-rw-r--r--src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj28
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs39
-rw-r--r--src/DotNetOpenAuth.Core/packages.config4
-rw-r--r--src/DotNetOpenAuth.Mvc/DotNetOpenAuth.Mvc.csproj92
-rw-r--r--src/DotNetOpenAuth.Mvc/MvcExtensions.cs61
-rw-r--r--src/DotNetOpenAuth.Mvc/Properties/AssemblyInfo.cs24
-rw-r--r--src/DotNetOpenAuth.Mvc/packages.config11
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/packages.config2
-rw-r--r--src/DotNetOpenAuth.sln13
-rw-r--r--src/packages/repositories.config1
15 files changed, 251 insertions, 74 deletions
diff --git a/nuget/DotNetOpenAuth.Mvc.nuspec b/nuget/DotNetOpenAuth.Mvc.nuspec
new file mode 100644
index 0000000..8b253b7
--- /dev/null
+++ b/nuget/DotNetOpenAuth.Mvc.nuspec
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>DotNetOpenAuth.Mvc</id>
+ <version>$version$</version>
+ <title>DotNetOpenAuth MVC extensions</title>
+ <authors>Andrew Arnott</authors>
+ <owners>Outercurve Foundation</owners>
+ <projectUrl>http://www.dotnetopenauth.net/</projectUrl>
+ <iconUrl>https://github.com/AArnott/dotnetopenid/raw/v3.4/doc/logo/dnoa-logo_32x32.png</iconUrl>
+ <licenseUrl>http://www.opensource.org/licenses/ms-pl.html</licenseUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <summary>Provides the HttpResponseMessage.AsActionResult() extension method.</summary>
+ <dependencies>
+ <dependency id="DotNetOpenAuth.Core" version="[$version$]" />
+ <dependency id="Microsoft.AspNet.Mvc" version="[5.0.0,6.0)" />
+ <dependency id="Microsoft.AspNet.Razor" version="[3.0.0,4.0)" />
+ <dependency id="Microsoft.AspNet.WebPages" version="[3.0.0,4.0)" />
+ <dependency id="Microsoft.Bcl" version="[1.1.3,2.0)" />
+ <dependency id="Microsoft.Bcl.Build" version="[1.0.10,2.0)" />
+ <dependency id="Microsoft.Net.Http" version="[2.2.15,3.0)" />
+ <dependency id="Microsoft.Web.Infrastructure" version="[1.0.0.0,2.0)" />
+ <dependency id="Validation" version="[2.0.2.13022,3.0)" />
+ </dependencies>
+ </metadata>
+ <files>
+ <file src="$OutputPath45$$signedSubPath$$identity$.dll" target="lib\net45-full\" />
+ <file src="$OutputPath45$$identity$.pdb" target="lib\net45-full\" />
+ <file src="$OutputPath45$$identity$.xml" target="lib\net45-full\" />
+
+ <file src="..\src\$Identity$\**\*.cs" target="src" exclude="..\src\$Identity$\obj\**" />
+ <file src="$GeneratedAssemblyInfoSourceFile$" target="src" />
+ </files>
+</package> \ No newline at end of file
diff --git a/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj b/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
index 6101222..dfa79a8 100644
--- a/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
+++ b/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
@@ -279,6 +279,10 @@
<Project>{60426312-6ae5-4835-8667-37edea670222}</Project>
<Name>DotNetOpenAuth.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\src\DotNetOpenAuth.Mvc\DotNetOpenAuth.Mvc.csproj">
+ <Project>{9d308ef2-2712-4f83-a14c-18bf08d45526}</Project>
+ <Name>DotNetOpenAuth.Mvc</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.AuthorizationServer\DotNetOpenAuth.OAuth2.AuthorizationServer.csproj">
<Project>{99bb7543-ea16-43ee-a7bc-d7a25a3b22f6}</Project>
<Name>DotNetOpenAuth.OAuth2.AuthorizationServer</Name>
diff --git a/samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj b/samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj
index c6ae9f7..1e373b3 100644
--- a/samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj
+++ b/samples/OAuthAuthorizationServer/OAuthAuthorizationServer.csproj
@@ -198,6 +198,10 @@
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
<Name>DotNetOpenAuth.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\src\DotNetOpenAuth.Mvc\DotNetOpenAuth.Mvc.csproj">
+ <Project>{9d308ef2-2712-4f83-a14c-18bf08d45526}</Project>
+ <Name>DotNetOpenAuth.Mvc</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.AuthorizationServer\DotNetOpenAuth.OAuth2.AuthorizationServer.csproj">
<Project>{99BB7543-EA16-43EE-A7BC-D7A25A3B22F6}</Project>
<Name>DotNetOpenAuth.OAuth2.AuthorizationServer</Name>
diff --git a/samples/OpenIdProviderMvc/OpenIdProviderMvc.csproj b/samples/OpenIdProviderMvc/OpenIdProviderMvc.csproj
index 98f06e4..449dd5d 100644
--- a/samples/OpenIdProviderMvc/OpenIdProviderMvc.csproj
+++ b/samples/OpenIdProviderMvc/OpenIdProviderMvc.csproj
@@ -167,6 +167,10 @@
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
<Name>DotNetOpenAuth.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\src\DotNetOpenAuth.Mvc\DotNetOpenAuth.Mvc.csproj">
+ <Project>{9d308ef2-2712-4f83-a14c-18bf08d45526}</Project>
+ <Name>DotNetOpenAuth.Mvc</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.Provider.UI\DotNetOpenAuth.OpenId.Provider.UI.csproj">
<Project>{9D0F8866-2131-4C2A-BC0E-16FEA5B50828}</Project>
<Name>DotNetOpenAuth.OpenId.Provider.UI</Name>
diff --git a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
index 0cd412b..749752a 100644
--- a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
+++ b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
@@ -184,6 +184,10 @@
<Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project>
<Name>DotNetOpenAuth.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\src\DotNetOpenAuth.Mvc\DotNetOpenAuth.Mvc.csproj">
+ <Project>{9d308ef2-2712-4f83-a14c-18bf08d45526}</Project>
+ <Name>DotNetOpenAuth.Mvc</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty.UI\DotNetOpenAuth.OpenId.RelyingParty.UI.csproj">
<Project>{1ED8D424-F8AB-4050-ACEB-F27F4F909484}</Project>
<Name>DotNetOpenAuth.OpenId.RelyingParty.UI</Name>
diff --git a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
index 459211f..0781b76 100644
--- a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
+++ b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
@@ -173,10 +173,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
- </Reference>
<Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NLog.2.1.0\lib\net45\NLog.dll</HintPath>
@@ -189,30 +185,6 @@
<HintPath>..\packages\Microsoft.Net.Http.2.2.15\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
- <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
- </Reference>
<Reference Include="Validation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Validation.2.0.2.13022\lib\portable-windows8+net40+sl5+windowsphone8\Validation.dll</HintPath>
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
index 4dfddae..7be618c 100644
--- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
@@ -24,7 +24,6 @@ namespace DotNetOpenAuth.Messaging {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
- using System.Web.Mvc;
using System.Xml;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
@@ -411,16 +410,6 @@ namespace DotNetOpenAuth.Messaging {
}
/// <summary>
- /// Wraps a response message as an MVC <see cref="ActionResult"/> so it can be conveniently returned from an MVC controller's action method.
- /// </summary>
- /// <param name="response">The response message.</param>
- /// <returns>An <see cref="ActionResult"/> instance.</returns>
- public static ActionResult AsActionResult(this HttpResponseMessage response) {
- Requires.NotNull(response, "response");
- return new HttpResponseMessageActionResult(response);
- }
-
- /// <summary>
/// Wraps an instance of <see cref="HttpRequestBase"/> as an <see cref="HttpRequestMessage"/> instance.
/// </summary>
/// <param name="request">The request.</param>
@@ -2043,33 +2032,5 @@ namespace DotNetOpenAuth.Messaging {
#endregion
}
-
- /// <summary>
- /// An MVC <see cref="ActionResult"/> that wraps an <see cref="HttpResponseMessage"/>
- /// </summary>
- private class HttpResponseMessageActionResult : ActionResult {
- /// <summary>
- /// The wrapped response.
- /// </summary>
- private readonly HttpResponseMessage response;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="HttpResponseMessageActionResult"/> class.
- /// </summary>
- /// <param name="response">The response.</param>
- internal HttpResponseMessageActionResult(HttpResponseMessage response) {
- Requires.NotNull(response, "response");
- this.response = response;
- }
-
- /// <summary>
- /// Enables processing of the result of an action method by a custom type that inherits from the <see cref="T:System.Web.Mvc.ActionResult" /> class.
- /// </summary>
- /// <param name="context">The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.</param>
- public override void ExecuteResult(ControllerContext context) {
- // Sadly, MVC doesn't support writing to the response stream asynchronously.
- this.response.SendAsync(context.HttpContext).GetAwaiter().GetResult();
- }
- }
}
}
diff --git a/src/DotNetOpenAuth.Core/packages.config b/src/DotNetOpenAuth.Core/packages.config
index 8e805a2..0364828 100644
--- a/src/DotNetOpenAuth.Core/packages.config
+++ b/src/DotNetOpenAuth.Core/packages.config
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.2" targetFramework="net45" />
- <package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
- <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
- <package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />
- <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="NLog" version="2.1.0" targetFramework="net45" />
<package id="Validation" version="2.0.2.13022" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/DotNetOpenAuth.Mvc/DotNetOpenAuth.Mvc.csproj b/src/DotNetOpenAuth.Mvc/DotNetOpenAuth.Mvc.csproj
new file mode 100644
index 0000000..16f53f4
--- /dev/null
+++ b/src/DotNetOpenAuth.Mvc/DotNetOpenAuth.Mvc.csproj
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ </PropertyGroup>
+ <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9D308EF2-2712-4F83-A14C-18BF08D45526}</ProjectGuid>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <AssemblyName>DotNetOpenAuth.Mvc</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.Product.props" />
+ <ItemGroup>
+ <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Private>True</Private>
+ <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.Extensions">
+ <HintPath>..\packages\Microsoft.Net.Http.2.2.15\lib\net45\System.Net.Http.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.Primitives">
+ <HintPath>..\packages\Microsoft.Net.Http.2.2.15\lib\net45\System.Net.Http.Primitives.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.WebRequest" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Validation">
+ <HintPath>..\packages\Validation.2.0.2.13022\lib\portable-windows8+net40+sl5+windowsphone8\Validation.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MvcExtensions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\DotNetOpenAuth.Core\DotNetOpenAuth.Core.csproj">
+ <Project>{60426312-6ae5-4835-8667-37edea670222}</Project>
+ <Name>DotNetOpenAuth.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Import Project="..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" />
+ <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
+ <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
+ <Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/src/DotNetOpenAuth.Mvc/MvcExtensions.cs b/src/DotNetOpenAuth.Mvc/MvcExtensions.cs
new file mode 100644
index 0000000..29f6747
--- /dev/null
+++ b/src/DotNetOpenAuth.Mvc/MvcExtensions.cs
@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------
+// <copyright file="MvcExtensions.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Messaging
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net.Http;
+ using System.Text;
+ using System.Threading.Tasks;
+ using System.Web.Mvc;
+ using DotNetOpenAuth.Messaging;
+ using Validation;
+
+ /// <summary>
+ /// DotNetOpenAuth extensions for ASP.NET MVC.
+ /// </summary>
+ public static class MvcExtensions {
+ /// <summary>
+ /// Wraps a response message as an MVC <see cref="ActionResult"/> so it can be conveniently returned from an MVC controller's action method.
+ /// </summary>
+ /// <param name="response">The response message.</param>
+ /// <returns>An <see cref="ActionResult"/> instance.</returns>
+ public static ActionResult AsActionResult(this HttpResponseMessage response) {
+ Requires.NotNull(response, "response");
+ return new HttpResponseMessageActionResult(response);
+ }
+
+ /// <summary>
+ /// An MVC <see cref="ActionResult"/> that wraps an <see cref="HttpResponseMessage"/>
+ /// </summary>
+ private class HttpResponseMessageActionResult : ActionResult {
+ /// <summary>
+ /// The wrapped response.
+ /// </summary>
+ private readonly HttpResponseMessage response;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HttpResponseMessageActionResult"/> class.
+ /// </summary>
+ /// <param name="response">The response.</param>
+ internal HttpResponseMessageActionResult(HttpResponseMessage response) {
+ Requires.NotNull(response, "response");
+ this.response = response;
+ }
+
+ /// <summary>
+ /// Enables processing of the result of an action method by a custom type that inherits from the <see cref="T:System.Web.Mvc.ActionResult" /> class.
+ /// </summary>
+ /// <param name="context">The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.</param>
+ public override void ExecuteResult(ControllerContext context) {
+ // Sadly, MVC doesn't support writing to the response stream asynchronously.
+ this.response.SendAsync(context.HttpContext).GetAwaiter().GetResult();
+ }
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.Mvc/Properties/AssemblyInfo.cs b/src/DotNetOpenAuth.Mvc/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..732f09e
--- /dev/null
+++ b/src/DotNetOpenAuth.Mvc/Properties/AssemblyInfo.cs
@@ -0,0 +1,24 @@
+//-----------------------------------------------------------------------
+// <copyright file="AssemblyInfo.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyCopyright("Copyright © 2012 Outercurve Foundation")]
+[assembly: CLSCompliant(true)]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bbb01d47-0265-4423-82a2-77be311ca7c6")]
diff --git a/src/DotNetOpenAuth.Mvc/packages.config b/src/DotNetOpenAuth.Mvc/packages.config
new file mode 100644
index 0000000..1d4c1ac
--- /dev/null
+++ b/src/DotNetOpenAuth.Mvc/packages.config
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
+ <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
+ <package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
+ <package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
+ <package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
+ <package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />
+ <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
+ <package id="Validation" version="2.0.2.13022" targetFramework="net45" />
+</packages> \ No newline at end of file
diff --git a/src/DotNetOpenAuth.OAuth2.Client/packages.config b/src/DotNetOpenAuth.OAuth2.Client/packages.config
index 2093e05..481b7f7 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/packages.config
+++ b/src/DotNetOpenAuth.OAuth2.Client/packages.config
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
- <package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />
diff --git a/src/DotNetOpenAuth.sln b/src/DotNetOpenAuth.sln
index ae1da5f..aae6d14 100644
--- a/src/DotNetOpenAuth.sln
+++ b/src/DotNetOpenAuth.sln
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
+# Visual Studio 2013
+VisualStudioVersion = 12.0.20827.3
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{20B5E173-C3C4-49F8-BD25-E69044075B4D}"
ProjectSection(SolutionItems) = preProject
..\build.proj = ..\build.proj
@@ -127,6 +129,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetOpenAuth.OAuth2.Clien
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuth2ProtectedWebApi", "..\samples\OAuth2ProtectedWebApi\OAuth2ProtectedWebApi.csproj", "{58A3721F-5B5C-4CA7-BE39-91640B5B4924}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetOpenAuth.Mvc", "DotNetOpenAuth.Mvc\DotNetOpenAuth.Mvc.csproj", "{9D308EF2-2712-4F83-A14C-18BF08D45526}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeAnalysis|Any CPU = CodeAnalysis|Any CPU
@@ -351,6 +355,12 @@ Global
{58A3721F-5B5C-4CA7-BE39-91640B5B4924}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58A3721F-5B5C-4CA7-BE39-91640B5B4924}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58A3721F-5B5C-4CA7-BE39-91640B5B4924}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.CodeAnalysis|Any CPU.ActiveCfg = Release|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.CodeAnalysis|Any CPU.Build.0 = Release|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9D308EF2-2712-4F83-A14C-18BF08D45526}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -381,6 +391,7 @@ Global
{60426312-6AE5-4835-8667-37EDEA670222} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{173E7B8D-E751-46E2-A133-F72297C0D2F4} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{115217C5-22CD-415C-A292-0DD0238CDD89} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
+ {9D308EF2-2712-4F83-A14C-18BF08D45526} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{3896A32A-E876-4C23-B9B8-78E17D134CD3} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{F8284738-3B5D-4733-A511-38C23F4A763F} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{F458AB60-BA1C-43D9-8CEF-EC01B50BE87B} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
diff --git a/src/packages/repositories.config b/src/packages/repositories.config
index 645599a..2b6bb00 100644
--- a/src/packages/repositories.config
+++ b/src/packages/repositories.config
@@ -18,6 +18,7 @@
<repository path="..\..\samples\OpenIdWebRingSsoRelyingParty\packages.config" />
<repository path="..\DotNetOpenAuth.Core.UI\packages.config" />
<repository path="..\DotNetOpenAuth.Core\packages.config" />
+ <repository path="..\DotNetOpenAuth.Mvc\packages.config" />
<repository path="..\DotNetOpenAuth.OAuth.Common\packages.config" />
<repository path="..\DotNetOpenAuth.OAuth.Consumer\packages.config" />
<repository path="..\DotNetOpenAuth.OAuth.ServiceProvider\packages.config" />