Base solution for your next web application
Open Closed

Password Reset Token on Azure #284


User avatar
0
daniel created

Hi All,

I've published the app on Azure - it appears to be up and running okay, however, I'm having a problem with the UserTokenProvider.

Everything is working fine on my local machine, but on Azure I'm running into the following error

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, which may be the case when the thread is impersonating.

After some reasearch, I've added the following to my web.config but this hasn't fixed it.

<system.identityModel>
	<identityConfiguration>
		<securityTokenHandlers>
			<add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler,  
					 System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
			<remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, 
					 System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
		</securityTokenHandlers>
	</identityConfiguration>
</system.identityModel>

I presume I'm missing something related to MachineKeySessionSecurity in my Global.asax.cs? Any suggestions would be very welcomed!


No answer yet!