Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

rmclient won't authenticate #28

Closed
andrasg opened this issue Jan 2, 2017 · 1 comment
Closed

rmclient won't authenticate #28

andrasg opened this issue Jan 2, 2017 · 1 comment

Comments

@andrasg
Copy link

andrasg commented Jan 2, 2017

I am trying to create a release summary extension. For this, I am using the ReleaseManagement/Core/RestClient in "vss-web-extension-sdk": "^2.109.1"

/// <reference types="vss-web-extension-sdk" />

"use strict";

import VSS_Common_Contracts = require("VSS/WebApi/Contracts");
import TFS_Release_Contracts = require("ReleaseManagement/Core/Contracts")
import RM_Client = require("ReleaseManagement/Core/RestClient")

var rmClient = RM_Client.getClient();
var c = VSS.getConfiguration();
c.onReleaseChanged(function (release : TFS_Release_Contracts.Release) {

    var webcontext = VSS.getWebContext();

    rmClient.getReleaseDefinition(webcontext.project.id, release.releaseDefinition.id).then(
        function (rel) 
        {
            console.log(rel.name);
        },
        function (error)
        {
            console.log(error);
        });
});

I am getting a 401 error though:

TF400813: Resource not available for anonymous access. Client authentication required.

What am I doing wrong?

@andrasg
Copy link
Author

andrasg commented Jan 2, 2017

What am I doing wrong?

Of course, forgetting to put the correct scope in the manifest of the extension causes an auth error... adding the scope fixed the issue, closing it.

@andrasg andrasg closed this as completed Jan 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant