我在诊断应用程序中的异常时遇到问题。它在开发和测试中工作正常,但在预生产中不起作用。
我收到访问被拒绝错误,我想这是因为该帖子没有冒充当前用户。 这是我的日志
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 01/02/2016 10:54:17
Event time (UTC): 01/02/2016 09:54:17
Event ID: b924fd2c31b44bb59f5e9b9b79f9afc6
Event sequence: 28
Event occurrence: 5
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/3/ROOT/SPApp/girsmt-3-130987927149445639
Trust level: Full
Application Virtual Path: /SPApp/girsmt
Application Path: \IIS-CERT\WebAppExt\SPApp\girsmt\
Machine name: D3IISFEC01
Process information:
Process ID: 26980
Process name: w3wp.exe
Account name: IIS APPPOOL\girsmt
Exception information:
Exception type: WebException
Exception message: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at Generali.SharePoint.Security.SPClientSecurityProvider.CreateContext()
at Generali.Security.SecurityContext.CreateFrom(ContextConfiguration config)
at Generali.Security.SecurityContext..ctor(ContextConfiguration config)
at HierarchyDA.DataAccess.Hierarchy..ctor(SecurityProvider securityProvider, String HierarchyId, String connectionString, String siteUrl)
at GEN.AG.GIRSMT.BusinessLayer.Controllers.DocumentHierarchyController.get_Hierarchy()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.DocumentHierarchyController.get_CurrentUserGroups()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.get_Permissions()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.CanDo(Permission permission, Policy policy)
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.CanEditSystemTables()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.TopMenuController.CanUseSeeAdminMenu()
at GEN.AG.GIRSMT.AppWeb.GeneralCounsel.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Request information:
Request URL: https://webappextcert.generali.com:443/spapp/girsmt/pages/admin/update.aspx?SPHostUrl=http://corpcert.generali.com/sites/GGC/girsmt&SPLanguage=en-US&SPClientTag=0&SPProductNumber=15.0.4569.1000
Request path: /spapp/girsmt/pages/admin/update.aspx
User host address: 10.180.71.189
User: CORPGEN\e3mpozz2
Is authenticated: True
Authentication Type: NTLM
Thread account name: IIS APPPOOL\girsmt
Thread information:
Thread ID: 2086
Thread account name: IIS APPPOOL\girsmt
Is impersonating: False
Stack trace: at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at Generali.SharePoint.Security.SPClientSecurityProvider.CreateContext()
at Generali.Security.SecurityContext.CreateFrom(ContextConfiguration config)
at Generali.Security.SecurityContext..ctor(ContextConfiguration config)
at HierarchyDA.DataAccess.Hierarchy..ctor(SecurityProvider securityProvider, String HierarchyId, String connectionString, String siteUrl)
at GEN.AG.GIRSMT.BusinessLayer.Controllers.DocumentHierarchyController.get_Hierarchy()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.DocumentHierarchyController.get_CurrentUserGroups()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.get_Permissions()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.CanDo(Permission permission, Policy policy)
at GEN.AG.GIRSMT.BusinessLayer.Controllers.PermissionsController.CanEditSystemTables()
at GEN.AG.GIRSMT.BusinessLayer.Controllers.TopMenuController.CanUseSeeAdminMenu()
at GEN.AG.GIRSMT.AppWeb.GeneralCounsel.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
这就是网络配置
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authorization>
<deny users="?" />
</authorization>
<httpHandlers>
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
</httpHandlers>
<identity impersonate="true" />
<globalization uiCulture="it" culture="it-IT" />
</system.web>
<appSettings>
<add key="ClientId" value="XXXXXXXXXXXXXXXXXXXXX" />
<add key="ClientSecret" value="XXXXXXXXXXXXXXXXXXXXXX=" />
<add key="IssuerId" value="XXXXXXXXXXXXXXXXXXXXXXXX" />
</appSettings>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="GEN.AG.GIRSMT.AppWeb.GIRSAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="GEN.AG.GIRSMT.AppWeb.GIRS">
<endpoint address="" behaviorConfiguration="GEN.AG.GIRSMT.AppWeb.GIRSAspNetAjaxBehavior" binding="webHttpBinding" contract="GEN.AG.GIRSMT.AppWeb.GIRS" />
</service>
</services>
<bindings>
<basicHttpBinding>
<!--Used by app for SharePoint-->
<binding name="secureBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<protocolMapping>
<add binding="basicHttpBinding" scheme="https" bindingConfiguration="secureBinding" />
</protocolMapping>
</system.serviceModel>
<connectionStrings>
<add name="PersistenceDBContext" connectionString="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
</handlers>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Credentials" value="true" />
<add name="Access-Control-Allow-Origin" value="http://webappextcert.generali.com" />
</customHeaders>
</httpProtocol>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
正如您所看到的,网络配置具有标识impersonate =“true”,但在日志中我仍然看到“冒充:假” 我错过了什么?