troygoode / engagenet Goto Github PK
View Code? Open in Web Editor NEWNugget that adds OpenID/Facebook/Twitter login via JanRain Engage for Asp.Net MVC
Home Page: http://rpxnow.com
Nugget that adds OpenID/Facebook/Twitter login via JanRain Engage for Asp.Net MVC
Home Page: http://rpxnow.com
Hi,
I believe I've hit a small issue when running over SSL (this is locally on my development PC, however I suspect it's also an issue on public facing sites).
It's in the EngageUrlBuilder, TokenUrl method where the code is checking for HTTP or HTTPS connections and compares to "ON". I'm using IIS7 which is presenting "on" in the HTTPS header, so it fails due to the case. I've re-worked this locally and tested and the following works:
public string TokenUrl(string pathAndQuery)
{
if (!pathAndQuery.StartsWith("/"))
pathAndQuery = "/" + pathAndQuery;
string protocol = _urlHelper.RequestContext.HttpContext.Request.ServerVariables["HTTPS"];
string host = _urlHelper.RequestContext.HttpContext.Request.ServerVariables["HTTP_HOST"];
bool isHttps = (string.Compare(protocol, "ON", System.StringComparison.InvariantCultureIgnoreCase) == 0);
return string.Format(
"{0}://{1}{2}",
isHttps ? "https" : "http",
host,
VirtualPathUtility.ToAbsolute(pathAndQuery)
);
}
Hope this helps.
Running on .NET 4.0 in the Dev Web Server (Cassandra) I get the following exception:
Data at the root level is invalid. Line 1, position 1.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
Source Error:
Line 12: throw new RPXException("No response to parse");
Line 13:
Line 14: var doc = XDocument.Load(responseReader, LoadOptions.None);
Line 15: if (doc.Root.Attribute("stat").Value == "ok")
Line 16: return doc.Root;
Source File: C:\Projects\RPXLib\src\RPXLib\RPXApiResponseParser.cs Line: 14
Stack Trace:
[XmlException: Data at the root level is invalid. Line 1, position 1.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +73
System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +122
System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +4076201
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +189
System.Xml.XmlTextReaderImpl.Read() +145
System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +44
System.Xml.Linq.XDocument.Load(TextReader textReader, LoadOptions options) +63
RPXLib.RPXApiResponseParser.Parse(TextReader responseReader) in C:\Projects\RPXLib\src\RPXLib\RPXApiResponseParser.cs:14
<...snip...>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.