Using ACS with the New Azure Web Sites

This is effectively just a “retweet” but I wanted to call this out because it was very helpful recently solving a problem in what I think is an important scenario – using ACS for federated identity management with an application hosted in the new Azure web sites.  Vittorio Bertocci posted on the relatively easy change you need to make in order to have this work when using .NET 4.5.  You typically see the problem manifest itself with an error message like this:  “The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread’s user context”.  Most solutions you will find on the net talk about writing a custom SessionSecurityTokenHandler, but that method doesn’t work with .NET 4.5 where WIF is basically absorbed into the core framework.


In any case, for more details please see Vittorio’s post on this topic here: 


For those of you wondering how/why I came across this, I built a web app for a demo with SharePoint 2013, and am using a combination of the new app model, the new Microsoft.SharePoint.Client.SharePointOnlineCredentials class for authentication, and now ACS and Azure web sites.  It is part of a simple little poll application, but is mostly interesting in tying all these pieces together.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s