1
votes

I'm trying to access the Team rooms functionality in Visual Studio Team Services (VSTS) With a valid token if I make a request to : https://.visualstudio.com/DefaultCollection/_apis/chat/rooms?api-version=1.0

I get an error 401. I have tested the token and I can make requests to other endpoints without an issue.

status code: 401, headers {
    "Content-Length" = 10828;
    "Content-Type" = "text/html; charset=utf-8";
    Date = "Fri, 17 Feb 2017 09:36:17 GMT";
    Server = "Microsoft-IIS/10.0";
    "Strict-Transport-Security" = "max-age=31536000; includeSubDomains";
    "Www-Authenticate" = Bearer;
    p3p = "CP=\"CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT\"";
    "x-content-type-options" = nosniff;
    "x-frame-options" = SAMEORIGIN;
    "x-powered-by" = "ASP.NET";
    "x-tfs-processid" = "925585e2-35c8-4691-b646-c96e48f04ee0";
    "x-tfs-serviceerror" = "TF400813%3a+Resource+not+available+for+anonymous+access.+Client+authentication+required.";
    "x-tfs-soapexception" = "%3c%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22%3f%3e%3csoap%3aEnvelope+xmlns%3asoap%3d%22http%3a%2f%2fwww.w3.org%2f2003%2f05%2fsoap-envelope%22%3e%3csoap%3aBody%3e%3csoap%3aFault%3e%3csoap%3aCode%3e%3csoap%3aValue%3esoap%3aReceiver%3c%2fsoap%3aValue%3e%3csoap%3aSubcode%3e%3csoap%3aValue%3eInvalidIdentityException%3c%2fsoap%3aValue%3e%3c%2fsoap%3aSubcode%3e%3c%2fsoap%3aCode%3e%3csoap%3aReason%3e%3csoap%3aText+xml%3alang%3d%22en%22%3eTF400813%3a+Resource+not+available+for+anonymous+access.+Client+authentication+required.%3c%2fsoap%3aText%3e%3c%2fsoap%3aReason%3e%3c%2fsoap%3aFault%3e%3c%2fsoap%3aBody%3e%3c%2fsoap%3aEnvelope%3e";
    "x-vss-s2stargetservice" = "00000002-0000-8888-8000-000000000000/visualstudio.com";
} })
1
show the request as raw content: is the token passed appropriately? You need to have a well formed request of course - Luca Cappa
Be aware that Team Rooms are being deprecated. blogs.msdn.microsoft.com/visualstudioalm/2017/01/04/… - Daniel Mann

1 Answers

0
votes

You need to grant application the Team rooms (read and write) permission.

enter image description here

So, check the application you registered whether has the Team rooms (read and write) scope. Also check the web application config file (web.config) whether there is vso.chat_write in Scope (key) value.

For example:

<add key="Scope" value="vso.agentpools vso.build vso.chat_write vso.code vso.dashboards vso.identity vso.packaging vso.release vso.test vso.work"/>