We have multiple new SharePoint 2013 farms built on Windows Server 2012 with a fairly standard, out of the box build. On all of these servers, we frequently get HTTP 500 Internal Server Errors. This frequently happens after the server is restarted or after the nightly app pool recycle. An IISReset usually fixes it but it may take several attempts before it takes. The ULS logs show some errors but a search online doesn't seem to help. We have production 2010 farms that are not experiencing this. It is only happening on the new 2013 farms. Two error messages we see in the ULS logs are listed below. Any hints, tips, or assistance otherwise is much appreciated. Thank you!
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. Provider type not defined.
(Exception from HRESULT: 0x80090017)
File name: 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=69c3241e6f0468ca' ---> System.Runtime.InteropServices.COMException (0x80090017):
Provider type not defined. (Exception from HRESULT: 0x80090017)
at Microsoft.SharePoint.SPSecurityContext.GetTrustChannel()
at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context,
Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs,
SecurityToken delegateTo, SPRequestSecurityTokenProperties properties)
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.
Provider type not defined. (Exception from HRESULT: 0x80090017).
-----