登录时重定向页面出现内部服务器错误 (500)

Internal Server Error (500) come up in redirect page when I Sign In

描述

我在本地部署了两个网站。一个是我在.NET-Core like(a.butter.com)构建的主要网站,另一个是在.NET-Framework like(passport.butter.com)构建的关于登录和注册的网站。今天,当我想在我的主网站 a.butter.com 中单击 Login 时,我发现登录成功并且 return 到 ReturnUrl a.butter.com。但是页面显示错误Internal Server Error (500)。谁能帮我解释一下为什么?

错误信息

[Error] Connection id ""0HL2JU00MCUG0"": An unhandled exception was thrown by the application. System.AggregateException: One or more errors occurred. (Response status code does not indicate success: 500 (Internal Server Error).) ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).

Postman 出错

Message": "An error has occurred.",

"ExceptionMessage": "An error occurred while performing an encryption >operation.", "ExceptionType": "System.Security.Cryptography.CryptographicException",

我明白了。解决方案是这样的。加密和解码是基于web.config.

中的MachineKey

C# web.config ... <machineKey decryption="AES" decryptionKey="223423424234234234SFSDFASGDGREGG" validation="SHA1" validationKey="436346RETEWRGSDAFASDFDSVASDFFASDDGRAGRGSFADFVAVDCSADCETREG" compatibilityMode="Framework45"/> ... 我发现 passport.butter.com 中的配置与另一个不同。所以,它出现了错误。当我把MachineKey改成和别人一样的时候就解决了我的问题