You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my company we had some private azure feeds where credentials are deactivated and only PAT's are accepted. Event when its possible add the PAT as password on code try to add the user
if (authOption.authType == AuthorizationType[AuthorizationType.basicAuth]) {
var bytes = utf8.encode(authOption.username + ":" + authOption.password);
var encoded = base64.encode(bytes);
requestOption.headers['Authorization'] = 'Basic ' + encoded;
}
maybe add on more authenthication type like "PAT" can help
if (authOption.authType == AuthorizationType[AuthorizationType.patAuth) {
var bytes = utf8.encode(authOption.password);
var encoded = base64.encode(bytes);
requestOption.headers['Authorization'] = 'Basic ' + encoded;
}
I've had success with PAT authentication for the local Azure DevOps Server (could work for the service as well). I have used basicAuth with VssSessionToken as the username and plaintext PAT as the password.
Make sure that the PAT has the "Packaging (Read)" assigned.
On my company we had some private azure feeds where credentials are deactivated and only PAT's are accepted. Event when its possible add the PAT as password on code try to add the user
if (authOption.authType == AuthorizationType[AuthorizationType.basicAuth]) {
var bytes = utf8.encode(authOption.username + ":" + authOption.password);
var encoded = base64.encode(bytes);
requestOption.headers['Authorization'] = 'Basic ' + encoded;
}
maybe add on more authenthication type like "PAT" can help
if (authOption.authType == AuthorizationType[AuthorizationType.patAuth) {
var bytes = utf8.encode(authOption.password);
var encoded = base64.encode(bytes);
requestOption.headers['Authorization'] = 'Basic ' + encoded;
}
or expected directly the pat in base64
if (authOption.authType == AuthorizationType[AuthorizationType.patAuth) {
requestOption.headers['Authorization'] = 'Basic ' + authOption.password;
}
The text was updated successfully, but these errors were encountered: