Coder Social home page Coder Social logo

Comments (6)

ericsciple avatar ericsciple commented on May 13, 2024 1

you can use getEndpointAuthorizationParameter('SystemVssConnection', 'AccessToken') to access the job token

i believe a 2x agent (2.105.7 would be a good backstop - i.e. TFS 2017 RTM agent) is required in order access secret variables.

if using the job token is not good for your scenario, then i would suggest switching to an input instead of relying on user to set a specific variable. then the user can pass their secret variable into the input - e.g. $(myusername)

from azure-pipelines-task-lib.

apucacao avatar apucacao commented on May 13, 2024

I forgot to mention that we're using vsts-task-lib version 0.5.11.

from azure-pipelines-task-lib.

apucacao avatar apucacao commented on May 13, 2024

Thanks @ericsciple, I can try that. One question though: how do I pass the job token along with request to VSTS? Do I need to set a header? Currently we're using basic authentication.

from azure-pipelines-task-lib.

ericsciple avatar ericsciple commented on May 13, 2024

i think you can pass it as the password. you may need to pass some dummy value for the username (e.g. abc). also i would recommend using bearer instead of basic since it does not require basic to be enabled for tfs on-prem installations.

also, i'm not familiar with the details, but you could also see what the nuget task does and use that as a go-by.

from azure-pipelines-task-lib.

ericsciple avatar ericsciple commented on May 13, 2024

...if you use the nuget task as a go-by, look for getSystemAccessToken

from azure-pipelines-task-lib.

bryanmacfarlane avatar bryanmacfarlane commented on May 13, 2024

You need to set the bearer header

https://github.com/Microsoft/vsts-node-api/blob/master/api/handlers/bearertoken.ts

If you use node api, you can construct it with that auth handler.

from azure-pipelines-task-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.