machinekey

ASP.NET webforms and MVC authentication sharing via cookie

非 Y 不嫁゛ 提交于 2019-11-28 11:42:36
There seems to be parts of the answers to my problem spread over multiple posts but putting it together hasn't worked so far for me, so I hope when this post is answered it will form more complete guide The problem I have an ASP.NET webforms application (W1) and I would like to begin an upgrade to a separate MVC application (M1) over a period of time. The solution containing W1 has been upgraded to 4.5 and M1 has been created in the solution. W1 uses the ASP.Net membership framework. The test case In M1, I added the Authorize attribute to the About page in the HomeController [Authorize] public

ASP.NET machinekey set keys in code

不打扰是莪最后的温柔 提交于 2019-11-28 11:24:07
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 from the web.config file, I want to inject those values during application startup and let the system use those instead. Is there any way to accomplish that without having to change web.config at all (to only change the in memory configuration)? I have tried accessing the configuration section but it is marked as readonly and is also sealed, so I

How to set machineKey on Azure Website

送分小仙女□ 提交于 2019-11-28 04:42:40
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 machineKey [1] . I've found a couple of similar questions here but the answers link to dead links. So, what's the solution? Surely there's a way to keep users logged in regardless of deployments on Azure. Try to reset the machine-key configuration section upon Application_Start : protected void Application_Start() { // ... var mksType = typeof

Asp.net Validation of viewstate MAC failed

放肆的年华 提交于 2019-11-27 12:40:33
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 <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. When page refresh goes,no problem.How can I solve this problem? mBotros If you're using a web farm and running the same application on multiple computers, you need to define the machine key explicitly in the machine.config file: <machineKey

IsolateApps causes Decryption key specified has invalid hex characters

无人久伴 提交于 2019-11-27 11:25:10
问题 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 selected "generate a unique key for each application" The web.config entry looks something like this: <machineKey decryption="DES" decryptionKey="{hex-key value},IsolateApps" validationKey="{hex-key value},IsolateApps" />; While this seems to work fine on

ASP.NET webforms and MVC authentication sharing via cookie

烂漫一生 提交于 2019-11-27 06:23:05
问题 There seems to be parts of the answers to my problem spread over multiple posts but putting it together hasn't worked so far for me, so I hope when this post is answered it will form more complete guide The problem I have an ASP.NET webforms application (W1) and I would like to begin an upgrade to a separate MVC application (M1) over a period of time. The solution containing W1 has been upgraded to 4.5 and M1 has been created in the solution. W1 uses the ASP.Net membership framework. The test

How to set machineKey on Azure Website

大城市里の小女人 提交于 2019-11-27 00:28:42
问题 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 machineKey [1]. I've found a couple of similar questions here but the answers link to dead links. So, what's the solution? Surely there's a way to keep users logged in regardless of deployments on Azure. 回答1: Try to reset the machine-key configuration

Asp.net Validation of viewstate MAC failed

◇◆丶佛笑我妖孽 提交于 2019-11-26 15:59:00
问题 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 <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. When page refresh goes,no problem.How can I solve this problem? 回答1: If you're using a web farm and running the same application on multiple

Losing Session State with ASP.NET/SQL Server

孤者浪人 提交于 2019-11-26 15:49:03
问题 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 state, and I believe this is because the request is being handled by the alternative server, so essentially the user is jumping from server to server, depending how the load balancer sees fit. I am not always "losing session state" at the same stage