Questions tagged [machinekey]

143 questions
63
votes
3 answers

Adding machineKey to web.config on web-farm sites

We (our IT partner really) recently changed some DNS for a web farmed site we have, so that the two production server have round-robin DNS switching between them. Prior to this switch we didn't really have problems with WebResource.axd files. Since…
Mark Ursino
  • 31,209
  • 11
  • 51
  • 83
59
votes
3 answers

IsolateApps causes Decryption key specified has invalid hex characters

I working on a MVC 4 site which has uses Authentication. The site requires that I specify the Machine Key values. I did this via the IIS interface having deselected the "automatically generate at runtime", generated the key values and having…
WernerVA
  • 1,051
  • 1
  • 10
  • 16
50
votes
17 answers

Asp.net Validation of viewstate MAC failed

I am receiving the following error at certain times on asp.net website. Sys.WebForms.PageRequestManagerServerErrorException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that
Arbelac
  • 1,698
  • 6
  • 37
  • 90
30
votes
3 answers

How to set machineKey on Azure Website

I'm running an Azure Website. Whenever I deploy, everyone gets logged out because the machineKey changes. I specified the machineKey in the web.config but this didn't solve the issue. I believe this is because Azure automatically overwrites the…
Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100
24
votes
1 answer

ASP.NET machineKey config section default location

Where do I find the machineKey config section for ASP.NET? I don't have one in my application Web.config, there isn't one in the root Web.config and there isn't one in my machine.config. Does this mean there is some other default hardcoded into…
Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
24
votes
9 answers

Getting the current ASP.NET machine key

I find myself wanting to get the ASP.NET machine key for the current application. This is, of course, easy if a machine key is specified in the configuration file, but if it's set to auto generate then there doesn't seem to be a public method…
blowdart
  • 55,577
  • 12
  • 114
  • 149
22
votes
1 answer

.Net Core Machine Key alternative for webfarm

I have been using dotnet core to create an application that runs in a Kubernetes cluster on Linux hosts. As I was testing it noticed getting exceptions when validating the CSRF tokens, that makes sense since I did not edit the machine key to be the…
WillemdeKok
  • 318
  • 2
  • 7
22
votes
2 answers

Machine Key changes when app pool is recycled

I am using MachineKey API to encrypt/decrypt a piece of information in an ASP.NET application. I am using MachineKey.Encode(data, MachineKeyProtection.All) and MachineKey.Decode(data, MachineKeyProtection.All) methods of API. Everything works…
Mazhar Qayyum
  • 630
  • 7
  • 22
19
votes
3 answers

asp.net viewstate encryption issue

I am attempting to turn on viewstate encryption Always as a security measure for my ASP.NET 3.5 website hosted in IIS6. We have viewstate turned off but still see some "controlstate" in this string. In a test environment I am able to simply set…
felickz
  • 4,292
  • 3
  • 33
  • 37
19
votes
3 answers

Losing Session State with ASP.NET/SQL Server

I have a ASP.NET MVC workflow configured as two websites managed by a load balancer. The websites use Sql Server as the session state provider and have authentication switch off (its not required). Now, sporadically I appear to be losing session…
Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
16
votes
3 answers

Uses for MachineKey in ASP.NET

What different ways are Machine Keys useful in asp.net? I think the following are correct but thought there may be more. Multiple applications can use the same cookie Multiple servers can work with the same viewstate
BenMaddox
  • 1,780
  • 3
  • 18
  • 30
9
votes
2 answers

Is Forms Authentication Ticket safe enough?

When a user logs in based on default Forms Authentication method, the server creates a cookie containing encrypted data (using Machine Key as key for encryption). It means that if someone find/guess/access Machine Key for the server, he will be…
9
votes
1 answer

Override MachineKey on Microsoft Azure App Services across multiple App Service Plan

I'm trying to set the Machine Key in Web.Config of ASP.Net MVC apps but it sounds like Azure automatically provision unique machine keys for each web app and override what's in my Web.Config. The reason I want to do that is because I have an App…
Phil
  • 91
  • 2
8
votes
1 answer

Share default OWIN tokens in .Net core

I have Authorization server which built on .NET 4.5.1 and use Microsoft.Owin.Security.OAuth Version=3.0.0 http://prntscr.com/hvwhl4 Tokens protected via machinkey (OAuthAuthorizationServerOptions.AccessTokenFormat is default). I also have many…
Alexey Gorbel
  • 220
  • 3
  • 11
8
votes
3 answers

ASP.NET machinekey set keys in code

I want to adjust the machine keys dynamically in code during runtime, for an IIS hosted ASP.NET MVC 4 website. The machine keys, encryption and validation keys as well as algorithms to use, are stored in a database. Instead of reading the values…
michael81
  • 206
  • 2
  • 8
1
2 3
9 10