summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/InfoCardRelyingParty/web.config2
-rw-r--r--samples/OAuthConsumer/Web.config2
-rw-r--r--samples/OAuthConsumerWpf/App.config2
-rw-r--r--samples/OAuthServiceProvider/Web.config2
-rw-r--r--samples/OpenIdProviderMvc/Web.config2
-rw-r--r--samples/OpenIdProviderWebForms/Web.config2
-rw-r--r--samples/OpenIdRelyingPartyMvc/Global.asax.cs3
-rw-r--r--samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj6
-rw-r--r--samples/OpenIdRelyingPartyMvc/Web.config28
-rw-r--r--samples/OpenIdRelyingPartyWebForms/Web.config2
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj4
-rw-r--r--src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs5
-rw-r--r--src/DotNetOpenAuth/Messaging/MessagingUtilities.cs4
-rw-r--r--src/DotNetOpenAuth/Xrds/ServiceElement.cs4
-rw-r--r--src/DotNetOpenAuth/Xrds/XrdElement.cs4
-rw-r--r--src/DotNetOpenAuth/Xrds/XrdsNode.cs4
16 files changed, 59 insertions, 17 deletions
diff --git a/samples/InfoCardRelyingParty/web.config b/samples/InfoCardRelyingParty/web.config
index f14d14b..533ff9b 100644
--- a/samples/InfoCardRelyingParty/web.config
+++ b/samples/InfoCardRelyingParty/web.config
@@ -45,7 +45,7 @@
<connectionStrings/>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
</system.net>
<system.web>
diff --git a/samples/OAuthConsumer/Web.config b/samples/OAuthConsumer/Web.config
index c3a808a..c9ac291 100644
--- a/samples/OAuthConsumer/Web.config
+++ b/samples/OAuthConsumer/Web.config
@@ -25,7 +25,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/samples/OAuthConsumerWpf/App.config b/samples/OAuthConsumerWpf/App.config
index e53b4a3..5857ffe 100644
--- a/samples/OAuthConsumerWpf/App.config
+++ b/samples/OAuthConsumerWpf/App.config
@@ -14,7 +14,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/samples/OAuthServiceProvider/Web.config b/samples/OAuthServiceProvider/Web.config
index d039daa..b9d5802 100644
--- a/samples/OAuthServiceProvider/Web.config
+++ b/samples/OAuthServiceProvider/Web.config
@@ -25,7 +25,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/samples/OpenIdProviderMvc/Web.config b/samples/OpenIdProviderMvc/Web.config
index f36bfcf..e10a972 100644
--- a/samples/OpenIdProviderMvc/Web.config
+++ b/samples/OpenIdProviderMvc/Web.config
@@ -34,7 +34,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/samples/OpenIdProviderWebForms/Web.config b/samples/OpenIdProviderWebForms/Web.config
index 3aba822..cd070ba 100644
--- a/samples/OpenIdProviderWebForms/Web.config
+++ b/samples/OpenIdProviderWebForms/Web.config
@@ -34,7 +34,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/samples/OpenIdRelyingPartyMvc/Global.asax.cs b/samples/OpenIdRelyingPartyMvc/Global.asax.cs
index d57a13f..8b117c0 100644
--- a/samples/OpenIdRelyingPartyMvc/Global.asax.cs
+++ b/samples/OpenIdRelyingPartyMvc/Global.asax.cs
@@ -18,13 +18,16 @@
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = string.Empty }); // Parameter defaults
+#if !Mono
routes.MapRoute(
"Root",
string.Empty,
new { controller = "Home", action = "Index", id = string.Empty });
+#endif
}
protected void Application_Start(object sender, EventArgs e) {
+ log4net.Config.XmlConfigurator.Configure();
RegisterRoutes(RouteTable.Routes);
}
}
diff --git a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
index a6fab7c..563cdbc 100644
--- a/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
+++ b/samples/OpenIdRelyingPartyMvc/OpenIdRelyingPartyMvc.csproj
@@ -17,7 +17,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DefineConstants>TRACE;DEBUG;Mono</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -30,6 +30,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\log4net.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core">
diff --git a/samples/OpenIdRelyingPartyMvc/Web.config b/samples/OpenIdRelyingPartyMvc/Web.config
index 8becaf6..bf37616 100644
--- a/samples/OpenIdRelyingPartyMvc/Web.config
+++ b/samples/OpenIdRelyingPartyMvc/Web.config
@@ -10,6 +10,7 @@
<configuration>
<configSections>
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false" />
<section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
@@ -33,7 +34,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
@@ -64,6 +65,31 @@
</messaging>
</dotNetOpenAuth>
+ <!-- log4net is a 3rd party (free) logger library that dotnetopenid will use if present but does not require. -->
+ <log4net>
+ <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
+ <file value="RelyingParty.log" />
+ <appendToFile value="true" />
+ <rollingStyle value="Size" />
+ <maxSizeRollBackups value="10" />
+ <maximumFileSize value="100KB" />
+ <staticLogFileName value="true" />
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%date (GMT%date{%z}) [%thread] %-5level %logger - %message%newline" />
+ </layout>
+ </appender>
+ <!-- Setup the root category, add the appenders and set the default level -->
+ <root>
+ <level value="INFO" />
+ <!--<appender-ref ref="RollingFileAppender" />-->
+ <appender-ref ref="RollingFileAppender" />
+ </root>
+ <!-- Specify the level for some specific categories -->
+ <logger name="DotNetOpenAuth">
+ <level value="INFO" />
+ </logger>
+ </log4net>
+
<appSettings/>
<connectionStrings/>
<system.web>
diff --git a/samples/OpenIdRelyingPartyWebForms/Web.config b/samples/OpenIdRelyingPartyWebForms/Web.config
index f952a6f..7c35f74 100644
--- a/samples/OpenIdRelyingPartyWebForms/Web.config
+++ b/samples/OpenIdRelyingPartyWebForms/Web.config
@@ -15,7 +15,7 @@
</uri>
<system.net>
- <defaultProxy enabled="true" />
+ <!--<defaultProxy enabled="true" />--> <!-- mono unsupported -->
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index ac2e516..01c4dd4 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DefineConstants>TRACE;DEBUG;Mono</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -53,7 +53,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
+ <DefineConstants>TRACE;Mono</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
index 9e9deb4..09edc01 100644
--- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
+++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
@@ -57,6 +57,7 @@ namespace DotNetOpenAuth.Messaging {
this.Url = request.Url;
this.UrlBeforeRewriting = GetPublicFacingUrl(request);
this.RawUrl = request.RawUrl;
+ Logger.Messaging.InfoFormat("Url: {0}, RawUrl: {1}", this.Url, this.RawUrl);
this.Headers = GetHeaderCollection(request.Headers);
this.InputStream = request.InputStream;
@@ -319,6 +320,7 @@ namespace DotNetOpenAuth.Messaging {
// HttpRequest.Url gives us the internal URL in a cloud environment,
// So we use a variable that (at least from what I can tell) gives us
// the public URL:
+#if !Mono // In ASP.NET MVC, Mono adds UrlRouting.axd to the URL here, which breaks OpenID return_to verification.
if (serverVariables["HTTP_HOST"] != null) {
ErrorUtilities.VerifySupported(request.Url.Scheme == Uri.UriSchemeHttps || request.Url.Scheme == Uri.UriSchemeHttp, "Only HTTP and HTTPS are supported protocols.");
string scheme = serverVariables["HTTP_X_FORWARDED_PROTO"] ?? request.Url.Scheme;
@@ -329,6 +331,7 @@ namespace DotNetOpenAuth.Messaging {
publicRequestUri.Port = hostAndPort.Port;
return publicRequestUri.Uri;
} else {
+#endif
// Failover to the method that works for non-web farm enviroments.
// We use Request.Url for the full path to the server, and modify it
// with Request.RawUrl to capture both the cookieless session "directory" if it exists
@@ -338,7 +341,9 @@ namespace DotNetOpenAuth.Messaging {
// Response.ApplyAppPathModifier(builder.Path) would have worked for the cookieless
// session, but not the URL rewriting problem.
return new Uri(request.Url, request.RawUrl);
+#if !Mono
}
+#endif
}
/// <summary>
diff --git a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
index 7d89b4e..38c431f 100644
--- a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
@@ -371,14 +371,18 @@ namespace DotNetOpenAuth.Messaging {
newRequest.AllowAutoRedirect = request.AllowAutoRedirect;
newRequest.AllowWriteStreamBuffering = request.AllowWriteStreamBuffering;
newRequest.AuthenticationLevel = request.AuthenticationLevel;
+#if !Mono
newRequest.AutomaticDecompression = request.AutomaticDecompression;
newRequest.CachePolicy = request.CachePolicy;
newRequest.ClientCertificates = request.ClientCertificates;
+#endif
newRequest.ConnectionGroupName = request.ConnectionGroupName;
newRequest.ContinueDelegate = request.ContinueDelegate;
newRequest.CookieContainer = request.CookieContainer;
newRequest.Credentials = request.Credentials;
+#if !Mono
newRequest.ImpersonationLevel = request.ImpersonationLevel;
+#endif
newRequest.MaximumAutomaticRedirections = request.MaximumAutomaticRedirections;
newRequest.MaximumResponseHeadersLength = request.MaximumResponseHeadersLength;
newRequest.MediaType = request.MediaType;
diff --git a/src/DotNetOpenAuth/Xrds/ServiceElement.cs b/src/DotNetOpenAuth/Xrds/ServiceElement.cs
index 0acf2b5..647ef42 100644
--- a/src/DotNetOpenAuth/Xrds/ServiceElement.cs
+++ b/src/DotNetOpenAuth/Xrds/ServiceElement.cs
@@ -48,7 +48,7 @@ namespace DotNetOpenAuth.Xrds {
get {
List<UriElement> uris = new List<UriElement>();
foreach (XPathNavigator node in Node.Select("xrd:URI", XmlNamespaceResolver)) {
- uris.Add(new UriElement(node, this));
+ uris.Add(new UriElement(node.Clone(), this));
}
uris.Sort();
return uris;
@@ -62,7 +62,7 @@ namespace DotNetOpenAuth.Xrds {
public IEnumerable<TypeElement> TypeElements {
get {
foreach (XPathNavigator node in Node.Select("xrd:Type", XmlNamespaceResolver)) {
- yield return new TypeElement(node, this);
+ yield return new TypeElement(node.Clone(), this);
}
}
}
diff --git a/src/DotNetOpenAuth/Xrds/XrdElement.cs b/src/DotNetOpenAuth/Xrds/XrdElement.cs
index a8cc145..2c03da8 100644
--- a/src/DotNetOpenAuth/Xrds/XrdElement.cs
+++ b/src/DotNetOpenAuth/Xrds/XrdElement.cs
@@ -35,7 +35,7 @@ namespace DotNetOpenAuth.Xrds {
// We should enumerate them in priority order
List<ServiceElement> services = new List<ServiceElement>();
foreach (XPathNavigator node in Node.Select("xrd:Service", XmlNamespaceResolver)) {
- services.Add(new ServiceElement(node, this));
+ services.Add(new ServiceElement(node.Clone(), this)); // .Clone() to workaround XPathNavigator mono bug
}
services.Sort();
return services;
@@ -149,7 +149,7 @@ namespace DotNetOpenAuth.Xrds {
xpath.Append("]");
var services = new List<ServiceElement>();
foreach (XPathNavigator service in Node.Select(xpath.ToString(), XmlNamespaceResolver)) {
- services.Add(new ServiceElement(service, this));
+ services.Add(new ServiceElement(service.Clone(), this)); // .Clone() to workaround XPathNavigator mono bug
}
// Put the services in their own defined priority order
diff --git a/src/DotNetOpenAuth/Xrds/XrdsNode.cs b/src/DotNetOpenAuth/Xrds/XrdsNode.cs
index e27a1b2..e2e5e78 100644
--- a/src/DotNetOpenAuth/Xrds/XrdsNode.cs
+++ b/src/DotNetOpenAuth/Xrds/XrdsNode.cs
@@ -32,7 +32,7 @@ namespace DotNetOpenAuth.Xrds {
ErrorUtilities.VerifyArgumentNotNull(node, "node");
ErrorUtilities.VerifyArgumentNotNull(parentNode, "parentNode");
- this.Node = node;
+ this.Node = node.Clone();
this.ParentNode = parentNode;
this.XmlNamespaceResolver = this.ParentNode.XmlNamespaceResolver;
}
@@ -44,7 +44,7 @@ namespace DotNetOpenAuth.Xrds {
protected XrdsNode(XPathNavigator document) {
ErrorUtilities.VerifyArgumentNotNull(document, "document");
- this.Node = document;
+ this.Node = document.Clone();
this.XmlNamespaceResolver = new XmlNamespaceManager(document.NameTable);
}