WebClient在ASP上获得登录页面响应.. NET ASPX处理程序使用匿名身份验证

本文关键字:程序 处理 ASPX 身份验证 NET 响应 ASP 登录 WebClient | 更新日期: 2023-09-27 18:14:45

我有一个ASP。Net应用程序配置为使用匿名身份验证,并且它具有"。数据处理程序页来处理来自WebClient对象的一些RPC调用。当托管在Windows Server 2008 R2上时,这工作得很好,但现在我正在迁移到新的Windows Server 2012服务器,我的WebClient查询甚至从未到达服务器。即使我在IIS中禁用了应用程序,我也会得到一个公司登录页面。如果我通过浏览器发送请求,它工作正常(当我有应用程序运行时)。在查看了浏览器请求中的请求头之后,我发现如果我在WebClient对象中添加一个cookie头,它会按预期工作。

client.Headers.Add("Cookie", "s_vi=[CS]v1|2A5F47608507C765-60000113A0063157[CE]; s_pers=%20s_vnum%3D1424366552113%2526vn%253D1%7C1424366552113%3B%20v44%3D%255B%255B%2527Direct%252520Load%2527%252C%25271421774552126%2527%255D%255D%7C1579540952126%3B%20s_pv%3Den_us%2520%253A%2520worldwide%2520%253A%2520global%2520landing%7C1421776386528%3B%20s_invisit%3Dtrue%7C1421776386530%3B%20s_lv%3D1421774586533%7C1516382586533%3B%20s_lv_s%3DFirst%2520Visit%7C1421776386533%3B%20s_cmc%3D1%7C1421776386540%3B%20s_nr%3D1426866016133-Repeat%7C1429458016133%3B%20s_fid%3D60E97348782318BD-305C723745392699%7C1490024416207%3B%20gpv_pn%3Ddivision%2520%253A%2520waterloo%2520works%2520%253A%2520home%7C1426867816209%3B; s_fid=22E0F07165D84047-07AD087FC8A8DC6F; s_nr=1477321997125-Repeat; SMSESSION=pSsBIy3Y/TvnON1g5zaFiMH5ZMLDyV2oOo8CKm9LeNiEOzl6WNjRfYDqEUkkimcpZ7VPVBSy/79IvtMWJwbDE0OTIjVFPFnBZImSLSeyMYNlDLtubzbAjJPDFsRs0tBGVsQyAKgUSGsfAXdNF5/bdCA17IYBgOaKTtrG2lSiDLkohvWilTxzAgC8MiW2RSkH/qyjmBfKzkoM2SA/1VYSkQRuCIFayc6x1aY7a7itZwHx1BnP5w98YenXIcYxkzXJjlboiINwh/C4zY2reReKMtzEvB5htc+L4kE9UoDoQkI3TP0Y9+Onz2aMa0V/mlbDrUyzpr/UADQwapzkinjvYIH6H/oG+3zM5pyryxNj8KMkqBIjcl8Gxdzmxs/pZZ0mKOh88VRbrYglxAXJbkevHZZDfb4gI6oAnlEEx0kQH9XyTjw0vK+f3qk3oqmXHg9X4aB+BHPjQVhYfCVyZ8YvlyXAAP2keJDoDED0f7MH70sQ2NLFSEXbv7Nt0dhsgCnur0RR2ZBqLjJmoEyDGNQ1DoxdLiJzQN3NBGFyOkELs0W6U1SbNZ2UudeQhg2NCmn161vwhoOBj5FdKj3+wzzoaRaG9zniHKfJDbaXIa5NKZtDkx7k059wn/XW+VbeqdvpVhQJIw/P7AsKc0EKznkuWCH2UXclUZyXT+V1HKvdeD1G6ouJzhHtmNx/FgyKGt+jzPXTT3TaHIQKE3/c6YwFAsHDOsC0dJQdxPeqEMrHe4zqA4VJzSN5wA2HNfr3vDVqOG0Tiv9afpwBmhwmA/v9CYG82Px7WzB1sBH5h7M3Igvq1NZtEHBxMV/S8joM8bhfnIudVpgui1TB8B0tciqHzBYKDQc3RUTe8bJdzmuffzT27LLprKGPjjqjaTUdluYCrSaH+AEvWFdtyfOoUJNGYBk3eB4Cl3HlezSkxGBXEYrHcTuWIhwLHdFDEOHbDW9yNY+zkPoS1QXpdaIxpFX3WTY4Ju6Fzy1Lui8MsPKKMJVd6wgnaKR0wITxEY8c6Kle3ObCuudpr0kAy5UsXlRkdTb9t2kLaEgLz03bzVi7WTSUTnMkYlFQ0OmXluUacU5mjKZP5EUX4iEBkDQkkxI851f3LrBL7pLt; gpv_pn=division%20%3A%20waterloo%20works%20%3A%20home; s_cc=true");

我有一种感觉,这个cookie正在使用我的凭据让这个WebClient访问这个新服务器,这不是我想要的配置方式。服务器配置是否不允许匿名访问?

WebClient在ASP上获得登录页面响应.. NET ASPX处理程序使用匿名身份验证

这似乎是因为服务器受到SiteMinder的保护。我必须找到一个允许经过身份验证的请求被我的站点接受的工作,但它超出了这个问题的范围。