Answered by:
Search is throwing Error - Request for security token failed with exception: System.ServiceModel.CommunicationException

Question
-
I had configured the SharePoint 2010 Search. All the Services are running properly. Also the crawling is in Incremental State.
I had created a document library with few documents. When I try to search a keyword from the Search box i am getting error.
An exception occurred when trying to issue security token: An error occurred while receiving the HTTP response to http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details..
Request for security token failed with exception: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) -
-- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) -
-- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) -
-- End of inner exception stack trace --- Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown
at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst)
at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)Kindly provide the resolution for this issue.
Thanks In Advance,
Suhail Tandel
Thursday, April 9, 2015 6:16 AM
Answers
-
this could be because, the authentication for security token service in IIS had "Forms" and "ASP.NET impersonation" enabled. This was preventing the user’s identity to be passed to the security token service and the token service was unable to generate tokens properly.
try this:
Open up the IIS Manager on the SharePoint server
Expand “Sites”
Expand “SharePoint Web Services” and select “SecurityTokenServiceApplication”
Double click on “Authentication”(under IIS)
Disable “Forms Authentication” and ASP.NET impersonation
Confirm that only Windows and Anonymous Authentication are enabled
IISRESETN i T i N
http://www.niteenbadgujar.com- Marked as answer by Tandel Thursday, April 9, 2015 10:53 AM
Thursday, April 9, 2015 7:52 AM
All replies
-
this could be because, the authentication for security token service in IIS had "Forms" and "ASP.NET impersonation" enabled. This was preventing the user’s identity to be passed to the security token service and the token service was unable to generate tokens properly.
try this:
Open up the IIS Manager on the SharePoint server
Expand “Sites”
Expand “SharePoint Web Services” and select “SecurityTokenServiceApplication”
Double click on “Authentication”(under IIS)
Disable “Forms Authentication” and ASP.NET impersonation
Confirm that only Windows and Anonymous Authentication are enabled
IISRESETN i T i N
http://www.niteenbadgujar.com- Marked as answer by Tandel Thursday, April 9, 2015 10:53 AM
Thursday, April 9, 2015 7:52 AM -
Hi,
Do please check the below to solve the issue
http://blogs.technet.com/b/sykhad-msft/archive/2012/02/25/sharepoint-2010-nailing-the-error-quot-the-security-token-service-is-unavailable-quot.aspx
Please remember to click 'Mark as Answer' on the answer if it helps you
- Proposed as answer by Maciej Stasiak Tuesday, April 14, 2015 12:51 PM
Thursday, April 9, 2015 8:47 AM -
Thanks Nitin,
I just performed the action provided by you and it works perfectly....
Kindly share the reason why we need to do this modification to Security Token Service...
Thanks Again...
Thursday, April 9, 2015 10:54 AM -
It's works for me as expected!Tuesday, April 14, 2015 12:52 PM