Symptom
You may be experiencing authentication issues with extensions running in an on-prem Team Foundation Server (TFS) 2015 Update 2.x environment. When you try to access an extension point, you may experience a “hanging” extension or a HTTP 401 error in the browser console window. The issue affects all users on the TFS instance.
Cause
Your may be missing a server name in the OAuth trusted issuers configuration.
To confirm, run the following SQL query against your TFS Configuration database:
SELECT * FROM tbl_RegistryItems WHERE ParentPath like ‘%#ConfigurationOAuthTrustedIssuers%’ AND PartitionId > 0
If you see more than one row, in particular the “tfs” row, you have a healthy configuration and this post is not applicable to you.
If you only see one row, as below, you may be experiencing the missing server name issue.
Resolution
WARNING
Serious problems might occur if you modify the configuration incorrectly by modifying the database or by using another method. These problems might require that you reinstall your Team Foundation Server. Microsoft cannot guarantee that these problems can be solved. Modify the configuration at your own risk.
Execute the following in SQL, after replacing <dnsname> with your server name:
declare @features dbo.typ_KeyValuePairStringTableNullable
insert into @features values(‘#ConfigurationOAuthTrustedIssuers<dnsname>‘, ‘Microsoft.TeamFoundation.Framework.Server.OAuth.ClientAuthTokenValidator’)
exec prc_UpdateRegistry @partitionId=1, @identityName = ‘00000000-0000-0000-0000-000000000000’, @registryUpdates = @features
Re-run the following SQL query against your TFS Configuration database to confirm that the tfs entry has been added.
SELECT * FROM tbl_RegistryItems WHERE ParentPath like ‘%#ConfigurationOAuthTrustedIssuers%’ AND PartitionId > 0
Reload your browser and verify that your extension is now functioning correctly.
For additional information on troubleshooting 401 errors, see the following article in the Microsoft Knowledge Base: 907273 Troubleshooting HTTP 401 errors in IIS
Applies to
Team Foundation Server 2015 Update 2
Team Foundation Server 2015 Update 2.1
Visual Studio Team Services Extensions are not supported on Team Foundation Server 2015 Update 1 or older