1

There are two SharePoint 2013 farms - Production and Development. We have an AD account which runs a couple of WCF services. If I login with that account to any computer (tried a couple)/or open IE with it, it can open Production web sites fine, but every time it tries to open Development it gets the following error:

The website cannot display the page

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

Any other users do not get this error message and can open Development sites just fine. Permissions are in place as well. I've tried re-provisioning Token service, recreated web applications, played around with web.configs etc.

ULS logs show the following:

09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   Claims Authentication   fsq6    High    SPSecurityContext: Get trust client failed with exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)  File name: 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' ---> System.Runtime.InteropServices.COMException (0x80070542): Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)     at Microsoft.SharePoint.SPSecurityContext.GetTrustChannel()     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo, SPRequestSecurityTokenProperties properties)  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   Claims Authentication   8305    Critical    An exception occurred when trying to establish endpoint for context: Could not load file or assembly 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542).  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General 8nca    Medium  Application error when access /businessappsdev/MedicalEvidence/_vti_bin/Lists.asmx, Error=Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   Authentication Authorization    agb9s   Medium  Non-OAuth request. IsAuthenticated=True, UserIdentityName=, ClaimsCount=0   a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General 8ofb    High    The following error occured while trying to read the common properties of the application with id: c4e60b63-b021-4272-9716-2cf06ab62797:  System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.     at System.Security.Principal.Win32.LsaOpenPolicy(String systemName, PolicyRights rights)     at System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed)     at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)     at System.Security.Principal.NTAccount.Translate(Type targetType)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKeyClaim(IClaimsIdentity claimsIdentity, SPClaim loginClaim)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Utilities.SPUtility.GetBinaryUserIDFromFullName(UTF8Encoding encoding, String fullName)     at Microsoft.SharePoint.Administration.SPPolicyCollection.get_PolicyCache()     at Microsoft.SharePoint.Administration.SPNativeConfigurationProvider.GetCommonApplicationProperties(Guid applicationId, Int32 currentZone, Boolean& recycleBinEnabled, Int32& newIndicatorCutOff, Boolean& presenceEnabled, Boolean& syndicationEnabled, Boolean& multipleAppDomainsEnabled, Object& securityPolicyCache, Object& zoneUrls, Object& appDomains, Object& officialFileNames, Int32& queryResultMax, Int32& listscopesMax, Int32& queryLookupFieldsMax, Boolean& clientObjectModelRequiresUseRemoteAPIsPermission) a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General 8e2s    Medium  Unknown SPRequest error occurred. More information: 0x80070005  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General aix9j   High    SPRequest.PreInitServer: UserPrincipalName=, AppPrincipalName= ,bstrAbsoluteRequestUrl=http://collaborationdev/businessappsdev/MedicalEvidence/_vti_bin/Lists.asmx ,bstrServerRelativeUrl=/businessappsdev/MedicalEvidence ,lZone=0 ,gApplicationId=c4e60b63-b021-4272-9716-2cf06ab62797 ,gSiteId=c4453da2-1e02-4696-8047-d2bb8c7b64d6 ,gDatabaseId=846b95f1-8794-40a9-811a-76511e0299bf ,bstrDatabaseServer=dev-spsql-01 ,bstrDatabaseName=SharePointCollaborationDev ,bstrDatabaseUsername=<null> ,bstrDatabasePassword=<null> ,fHostHeaderIsSiteName=False ,bstrAppHostHeaderRedirectDomain=<null> ,fAppWebRequest=False ,bstrAppDomain=dev.partnershipapps.int ,bstrRequestAppWebDomainId=<null> ,bstrAppSiteDomainPrefix=<null> ,iDatabaseVersionMajor=15 ,iDatabaseVersionMinor=0 ,iDatabaseVersionBuild=160 ,iDatabaseVersionRevision=0  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General ai1wu   Medium  System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:    at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)     at Microsoft.SharePoint.SPWeb.InitializeSPRequest()     at Microsoft.SharePoint.SPWeb.EnsureSPRequest()     at Microsoft.SharePoint.WebControls.SPControl.EnsureSPWebRequest(SPWeb web)     at Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context)     at Microsoft.SharePoint.ApplicationRuntime.SoapApplication.HandleError(HttpApplication app, Boolean tryUseRedirect)     at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.ErrorAppHandler(Object oSender, EventArgs ea)     at System.EventHandler.Invoke(Object sender, EventArgs e)     at System.Web.HttpApplication.RaiseOnError()     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)  a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4
09/16/2016 15:53:52.98  w3wp.exe (0x3364)   0x23D0  SharePoint Foundation   General ftd0    Medium  Access Denied. Exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:   at Microsoft.SharePoint.Library.SPRequestInternalClass.PreInitServer(String bstrAbsoluteRequestUrl, String bstrServerRelativeUrl, Int32 lZone, Guid gApplicationId, Guid gSiteId, Guid gDatabaseId, String bstrDatabaseServer, String bstrDatabaseName, String bstrDatabaseUsername, String bstrDatabasePassword, Boolean fHostHeaderIsSiteName, String bstrAppHostHeaderRedirectDomain, Boolean fAppWebRequest, String bstrAppDomain, String bstrRequestAppWebDomainId, String bstrAppSiteDomainPrefix, Int32 iDatabaseVersionMajor, Int32 iDatabaseVersionMinor, Int32 iDatabaseVersionBuild, Int32 iDatabaseVersionRevision)     at Microsoft.SharePoint.Library.SPRequest.PreInitServer(String bstrAbsoluteRequestUrl, String bstrServerRelativeUrl, Int32 lZone, Guid gApplicationId, Guid gSiteId, Guid gDatabaseId, String bstrDatabaseServer, String bstrDatabaseName, String bstrDatabaseUsername, String bstrDatabasePassword, Boolean fHostHeaderIsSiteName, String bstrAppHostHeaderRedirectDomain, Boolean fAppWebRequest, String bstrAppDomain, String bstrRequestAppWebDomainId, String bstrAppSiteDomainPrefix, Int32 iDatabaseVersionMajor, Int32 iDatabaseVersionMinor, Int32 iDatabaseVersionBuild, Int32 iDatabaseVersionRevision).    a25aa49d-2a7c-8092-ca9b-c59a2ccea2c4

This line worries me the most:

IsAuthenticated=True, UserIdentityName=, ClaimsCount=0

As it usually shows information like UserIdentityName and ClaimsCount for other users.

Windows Event Viewer log this error every time that accounts tries to open a site/page in SharePoint:

Claims Authentication

An exception occurred when trying to establish endpoint for context: Could not load file or assembly 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542).

Does anyone have a clue of what has gone wrong?

2
  • A 500 series error is usually an improperly formatted web.config file. Try adding .XML as the web.config extension and then try to open it with Internet Explorer. If it's the problem, IE will tell you exactly where it is. If the XML loads in IE though, the web.config is fine. Mar 21, 2017 at 2:01
  • Check this 500 Internal Server Error in SharePoint Nov 10, 2021 at 20:17

3 Answers 3

0

Have you seen the troubleshooting steps at http://social.technet.microsoft.com?

I'd start by working through those to see whether they resolve your issue.

0

Try reinstalling the prereq.

– Microsoft Identity Extensions http://go.microsoft.com/fwlink/?LinkID=252368

For Sharepoint

https://blogs.technet.microsoft.com/meamcs/2012/12/26/install-and-download-sharepoint-2013-prerequisites-offline-manually/

0

Check you Secure token service app pool status, recycle it once and check if the issue still persists.

2
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review Aug 29, 2018 at 6:47
  • i put my solution there as well, " To recycle the secure token service app pools ", Will be more descriptive from next time and will remember you advice as well for my future comments. Aug 29, 2018 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.