Some years ago I used this component to build a support tool.
Users complete an OS form and it creates a ticket on the Devops Board.
To do this I had to create a Personal Access Token in Azure.4 years later the token expired.I couldn't extend it so had to create a new token.
The trouble is I have no idea where the connecter gets the token from? I can't remember how I got this to work 4 years ago.
In the AzureDevOpsConnector there is an OnBeforeRequest which is getting the following "Name":"Authorization" and "Value":"V67dfjkj23343.....etc" - The old token.I have created a new token but don't know how to implement it?Does anyone else have any experience with this component?
You’re seeing the old PAT in the Authorization header inside the REST API’s OnBeforeRequest callback. That value is not being pulled dynamically from Azure; it’s something you (or someone) hard‑coded or set via a site/module variable 4 years ago.
Authorization
OnBeforeRequest
You now need to replace it with your new PAT and, ideally, move it to a safer place.
Below are the common patterns used in OutSystems 11 to pass Azure DevOps PATs; one of these will match what you did before.
For Azure DevOps REST APIs, the PAT is usually sent as:
Authorization: Basic <base64(":"+PAT)>
OutSystems sends this via the Headers.List in OnBeforeRequest. In your screenshot, you see:
Headers.List
Name
"Authorization"
Value
"Basic V29y..."
Basic <base64 string>
So you need to update this "Value" to use your new PAT.
"Value"
Open the OnBeforeRequest server action of the REST API:
Headers.List.Current.Value
Headers.List[<index>].Value
Typical patterns:
Example:
Headers.List[2].Name = "Authorization" Headers.List[2].Value = "Basic V29yZ...oldToken...";
or:
Headers.List.Current.Name = "Authorization" Headers.List.Current.Value = "Basic V29yZ...oldToken...";
In this case, just replace the old string with your new encoded string (see section 3 below).
Often people don’t hard‑code PATs in the action, but read them from a Site Property, e.g.:
Headers.List[2].Name = "Authorization" Headers.List[2].Value = Site.AzureDevOpsPATAuth
or from an Application/Module parameter.
Steps:
AzureDevOpsPAT
DevOps_PAT
AzureDevOpsAuthHeader
If this is a Site Property, remember to:
Sometimes the PAT is kept raw and encoded at runtime, e.g.:
Headers.List[2].Name = "Authorization" Headers.List[2].Value = "Basic " + Base64Encode(":" + Site.AzureDevOpsPAT)
In this case, the thing you must update is Site.AzureDevOpsPAT (the raw PAT), not the Base64 string.
Site.AzureDevOpsPAT
Given your new PAT (for example: myNewPATToken), Azure DevOps expects:
myNewPATToken
":" + PAT
":myNewPATToken"
OlRlc3RUb2tlbg==
Authorization: Basic OlRlc3RUb2tlbg==
You can:
Use any external tool (e.g. online Base64 encoder, or Postman) to get the Basic ... value and paste it into your Site Property / assignment.
Basic ...
Or do it in OutSystems:
Add the Text extension from System Components (or a Base64 extension).
In OnBeforeRequest, do something like:
LocalAuthString = ":" + Site.AzureDevOpsPAT Encoded = BinaryDataToBase64(TextToBinaryData(LocalAuthString)) Headers.List[2].Name = "Authorization" Headers.List[2].Value = "Basic " + Encoded
But since you already had this working four years ago, most likely it’s already encoded and hard‑coded or stored in a Site Property. You just need to overwrite that stored value with the new one.
Search for the old token:
V67dfjkj2
Update it:
Basic <Base64>
Publish the module and test again:
Headers.Current.Value
If it’s not already using a Site Property, this is a good moment to:
Create a Site Property AzureDevOpsAuthorizationHeader (or similar).
AzureDevOpsAuthorizationHeader
Set it to Basic <yourBase64PAT> in the environment.
Basic <yourBase64PAT>
In OnBeforeRequest, just do:
Headers.List[2].Name = "Authorization" Headers.List[2].Value = Site.AzureDevOpsAuthorizationHeader
This way, when the PAT expires again, you only update the Site Property value (no code change).
If you describe what you see in the OnBeforeRequest assignments (or the result of the “Find in Module” search), I can point exactly which field to change and what the new value should look like.
Hi @JayPea
Can you show your full OnBeforeRequest action?
Hi @Łukasz Kaproń I found a hack fix which works and as Azure will stop using Personal Access Tokens in December the connector will stop working completely, I expect. I will have to build my own solution so I am happy with the hack fix for now.
Thanks,
JayPea