SignalR and Azure Websites Error

SignalR and Azure Websites Weird Error

Working with some finishing touches making my Push Demos more consistent I started encounter a failure with SignalR when I deployed to my Azure Website.  I had to deploy the JS code with a debugger; statement and then use Chrome to get the actual error:

“The data protection operation was unsuccessful”

I am still working to understand what this actually means but in the meantime Stack Overflow was once again useful in finding a way around this problem: http://stackoverflow.com/questions/15393684/signalr-cryptographicexception-on-azurewebsites

It seems to be related to the Cryptography settings on Azure Websites, I hope to provide more useful information later.  For now, I hope to save people anguish by at least offering a solution.

Update

After conversations with David Fowler and Damian Edwards (the creators of SignalR) I have discovered the above implementation is extremely insecure and not recommended.  The problem is actually the usage of a custom Dependency Resolver for SignalR.  Because mine is custom, to allow dependency injection via Ninject, I was not getting the provided IProtectedData dependency.  The answer, for Ninject is the following block:

_container.Bind().To();

This will correctly fix the problem and maintain security.  Cheers
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s