Azure Exception after scaling
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
I have recently scaled my application deployed in Azure for 2 instances. After scaling that I got the above exception when loading the application. After searching for hours I came across the solution for it.
What you have to do is add the following code snippet in your configuration.
- <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>
For more information visit here.
Happy Coding !!!!!!
Comments
Post a Comment