SharePoint 2010: Nailing the error "The Security Token Service is unavailable"
First of all let’s talk about STS (Security Token Service)
- An STS is a specialized Web service that is designed to respond to requests for security tokens and provide identity management. The core functionality of every STS is the same, but the nature of the tasks that each STS performs depends on the role the STS plays in relation to the other STS Web services in your design. (refer-http://technet.microsoft.com/en-us/library/ee806864.aspx)
- STS is neither a SharePoint service, nor a window service, but actually a WCF web service
- Many SharePoint Services like User Profile Sync Service, SharePoint Search Service are Claims aware and such SharePoint Services will need STS to be up and running in a stable condition
- Let's take Search as an example: Let's take a case where Query Component is hosted on the App Server and a User hits the WFE and performs a Search. In this case the WFE will communicate with the Query Component on the App Server by making use of its STS to get the Claim, and the same is sent to the App Server. Without STS working, this communication will not be possible.
- Also User Profile Synchronization Service (UPSS) cannot start if the STS is not in a healthy condition
- Not only SharePoint Services, even Web Applications will require STS to be working for the Intra/Inter Farm Authentication.
- The below figure shows that within a SharePoint Farm the Intra/Inter Farm Authentication happens using Claims Authentication, and since it uses Claims Authentication, it is more than required for the STS to be working

I have seen numerous cases where the UPSS fails to start because of the unavailability of the STS. In such cases you can also see following errors logged:
In SharePoint Health Analyzer: "The Security Token Service is unavailable"
In SharePoint ULS logs while starting UPSS, errors like:
- An exception occurred when trying to issue security token: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error (OR)
- Request for security token failed with exception: System.ServiceModel.ServiceActivationException: The requested service,'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas' could not be activated (OR)
- An exception occurred when trying to issue security token: The requested service,'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas' could not be activated
You may not see all the errors as shown above, I'm just trying to collate the common errors seen while starting UPSS when STS is broken.
To troubleshoot such issues, it will be good to check if we can browse to the STS Web Service page.
To browse you have to go to IIS Manager --> Sites --> SharePoint WebServices --> SecurityTokenServiceApplication, click on 'Content View' down at the bottom, right click on Securitytoken.svc and click Browse (as shown below)

The expected page to see if STS is working will be as shown below:

As long as you get the above message while browsing, be sure that the STS is working just fine. In cases where STS is broken, you will not be able to browse to the above web service. You will get errors like Server Error in '\' Application, or Internet Explorer cannot display the web page etc.
How to fix STS?
Step One:
Right click on the SecurityTokenServiceApplication and click Explore, copy the web.config and compare the file with the file attached, which is completely out of the box with no modifications. If you find a lot of changes in the web.config file on your Farm with that of mine, replace the file on SecurityTokenServiceApplication(please also have the copy of the original web.config), perform an IIS reset and check if the STS page comes as expected
Step Two:
A BIG Thank You! To Abhishek Saigal (one of the finest resource in SharePoint Admin world) who came up with this fix, which has a success rate of 99.99%
I have tried this fix on numerous User Profile cases where UPSS could never start due to broken STS, and after STS was fixed UPSS started like a charm!
The below PowerShell commands re-provisions all the SharePoint Web Services, and this is one of the safest way to get the STS working.
There is no need to be afraid of losing any data/applications on SharePoint while/after running the below commands
Run the following commands one by one on SharePoint PowerShell:
$h = Get-SPServiceHostconfig
$h.Provision()
$services = Get-SPServiceApplication
foreach ($service in $services) { $service.provision();
write-host $service.name}
The output will look something like shown below:

Perform an IIS Reset and give another shot to browse the STS, and I'm sure you will see positive results!
Once the STS page is accessible successfully, try and start the UPSS one more time and very likely the UPSS will start successfully.
I'll be surprised to see if this fix fails and be more than happy to help you fix it!
SharePoint 2010: Nailing the error "The Security Token Service is unavailable"的更多相关文章
- sharepoint 2010 创建自定义的ASP.NET Web Service (上)
项目背景 根据客户需求在SharePoint 2010 中创建自定义的ASP.NET Web Service可以分为3种方式(我所知道的).废话少说,下面一一列举: 创建方式 MSDN 官方博客自己的 ...
- Developing a Custom Membership Provider from the scratch, and using it in the FBA (Form Based Authentication) in SharePoint 2010
//http://blog.sharedove.com/adisjugo/index.php/2011/01/05/writing-a-custom-membership-provider-and-u ...
- {sharepoint} More on SharePoint 2010 Application Pools
More on SharePoint 2010 Application Pools Print | posted on Friday, December 04, 2009 3:26 PM Blimey ...
- Upgrade from SharePoint 2010 to SharePoint 2016
[转]http://nikcharlebois.com/upgrade-from-sharepoint-2010-to-sharepoint-2016/ In this blog, I will go ...
- SharePoint 2010 出错! HTTP Error 503. The service is unavailable
转:http://544729.blog.51cto.com/534729/464087 昨天,公司的sharepoint 2010 无法打开,提示HTTP Error 503. The servic ...
- Searching External Data in SharePoint 2010 Using Business Connectivity Services
from:http://blogs.msdn.com/b/ericwhite/archive/2010/04/28/searching-external-data-in-sharepoint-2010 ...
- SharePoint 2010 配置基于MemberShip的身份验证
场景:通常需要为sharepoint打通其他的系统整合到sharepoint认证,ad通常是为内部域用户,外网访问的可以使用membership来登录,那么这个既可以内部用户访问,外部用户也可以访问 ...
- 安装InfoPath 2013后 SharePoint 2010 出现 “找不到 Microsoft.Office.InfoPath, Version=14.0.0....” 的错误的解决方案
1. 症状 您的SharePoint 2010的服务器是不是最近一直出现这个错误呢? Could not load file or assembly 'Microsoft.Office.InfoPat ...
- Sharepoint 2010 工作流启动时处理表单出错
问题: Shareoint 2010 列表工作流启动时,显示“处理表单时出现严重错误”. Error Message-1: Object doesn't support property or met ...
随机推荐
- 关于html、asp、php模板引擎、aspnet mvc、REST的一点思考
先看我对REST的一点认识,下面是<rest实战> 这本书的序言文字: 在我刚刚开始从事解决计算问题的时候,业界就有很多人有一个愿望:将系统设计为能够被自由组合的组件.互联网(I ...
- spring 启动流程
AbstractApplicationContext 分析 启动流程 // Prepare this context for refreshing.prepareRefresh(); 1. // In ...
- 设计师必备!免费下载 PSD 素材的32个网站
今天我想和大家分享一组可以免费下载 PSD 图形素材的最好的网站. PSD 文件是非常有用的资源,因为你可以看到所有的层,使用了什么技术来创建出这些作品和效果. 某些列出的网站可能已是众所周知的,但你 ...
- Lo-Dash – 替代 Underscore 的优秀 JS 工具库
前端开发人员大都喜欢 Underscore,它的工具函数很实用,用法简单.这里给大家推荐另外一个功能更全面的 JavaScript 工具——Lo-Dash,帮助你更好的开发网站和 Web 应用程序. ...
- Cocos2dx-3.0版本 从开发环境搭建(Win32)到项目移植Android平台过程详解
作为重量级的跨平台开发的游戏引擎,Cocos2d-x在现今的手游开发领域占有重要地位.那么问题来了,作为Cocos2dx的学习者,它的可移植特性我们就需要掌握,要不然总觉得少一门技能.然而这个时候各种 ...
- 如何使用DDMS Heap查看Android应用内存情况
作为大四毕业生,而且还是二本,加上技术基础不咋样,找工作自然也是辛酸得很...最糟糕的情况就是一开始实在是太小看了求职之路的艰辛,整个9月都是无所事事的度过,直到月底面试腾讯被鄙视后才顿然醒悟,意识到 ...
- SQL SERVER 分布式事务(DTC)
BEGIN DISTRIBUTED TRANSACTION指定一个由 Microsoft 分布式事务处理协调器 (MS DTC) 管理的 Transact-SQL 分布式事务的起始. 语法BEGIN ...
- .NET 笔试题--自已作答
以下题目,我已全部作答,答案仅供参考!水平和理解有限,可能有误,欢迎指正,谢谢! 1. 填空: (1)面向对象的语言具有__继承______性._____多态____性.____封装____性. (2 ...
- IOS开发UI基础 UIDatePicker的属性
UIDatePicker • Locale设置DatePicker的地区,即设置DatePicker显示的语言.// 1.跟踪所有可用的地区,取出想要的地区 NSLog(@& ...
- spring事务与消息队列
在开发过程中,遇到一个bug,产生bug的原因是spring事务提交晚于消息队列的生产消息,导致消息队列消费消息时获取到的数据不正确.这篇文章介绍问题的产生和一步步的解决过程. 一.问题的产生: 场景 ...