Comments (6)
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.
I forgot to mention that we're using vsts-task-lib
version 0.5.11.
from azure-pipelines-task-lib.
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.
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.
...if you use the nuget task as a go-by, look for getSystemAccessToken
from azure-pipelines-task-lib.
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)
- Invalid download directory for MockTestRunner (EPERM) HOT 2
- environment variables are not picked up by task. HOT 2
- Secrets (within quotes) that are part of Variable Group linked to KeyVault are not masked in logs HOT 2
- visibleRule validation failing for custom extension HOT 2
- ToolRunner is leaking the command line HOT 2
- How to authenticate using AccessToken to call DevOps API from custom PowerShell task HOT 4
- ToolRunner does not properly buffer the `stdline` and `errline`. HOT 1
- CVE-2022-37614: Critical Vulnerability in mockery module HOT 16
- Version of VstsTaskSdk packages in PSGallery module stop at 0.11.0 and does not contain fixes from 0.12.0 thru 0.14.0. Please publish newer versions referenced in release notes. HOT 2
- FR - Provide a way to get Task/Extension information HOT 4
- azure-pipelines-task-lib/node/docs /proxy.md contains a minor mistake on one of the samples HOT 4
- Build issues with deasync HOT 6
- Node version discrepancy between task library docs, tutorial docs, build, and mock task runner HOT 3
- `azure-pipelines-task-lib/task`'s `execAsync` fails on `this.tool(...)` HOT 2
- azure-pipelines-task-lib/task's _argStringToArray strips double quotes HOT 2
- It is not clear which version of the node is supported by the version of the azure-pipelines-task-lib HOT 3
- Implementing custom pipeline task to execute multiple tasks in parallel HOT 1
- Implement log grouping commands HOT 4
- Find-Match crashes if Onedrive synced file is missing on harddisk - Find-Match : Cannot convert value "4199968" to type "VstsTaskSdk.FS.Attributes" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. HOT 1
- clarify *wrapper task* and *task variable* HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-pipelines-task-lib.