How is your experience with the OutSystems Community?
11
Views
3
Comments
Solved by AI
Azure Devops Connector (Fore component)

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?

2023-12-26 10-35-28
OutSystems Neo
Staff
Solution by AI
AI Generated

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.

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.


1. How the Azure DevOps PAT should be sent

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:

  • Name: "Authorization"
  • Value: "Basic V29y..." (this is your old PAT encoded as Basic <base64 string>)

So you need to update this "Value" to use your new PAT.


2. Where the value is coming from

Open the OnBeforeRequest server action of the REST API:

  1. In Logic > Integrations > REST > [your AzureDevOpsConnector] > OnBeforeRequest, open the action.
  2. Look for assignments to:
    • Headers.List.Current.Value
    • or something like Headers.List[<index>].Value
    • or a loop over headers, adding an “Authorization” header.

Typical patterns:

A. Hard‑coded Authorization header

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).


B. Authorization value coming from a Site Property / Module variable

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:

  1. Check if there is a Site Property in the module (Data > Site Properties) with a name like:
    • AzureDevOpsPAT
    • DevOps_PAT
    • AzureDevOpsAuthHeader
  2. Open it and see if its value contains the string "Basic V29y...".
  3. Replace that value with your new encoded PAT string (again, see section 3).

If this is a Site Property, remember to:

  • Publish the module after editing.
  • Go to Lifetime (or Service Center) and ensure the Site Property value is updated in the environment (if you’re using different values per environment).

C. Authorization built dynamically each request

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.


3. Generating the correct Authorization header

Given your new PAT (for example: myNewPATToken), Azure DevOps expects:

  1. Concatenate ":" + PAT → ":myNewPATToken"
  2. Base64‑encode that string → e.g. ":" + PAT → OlRlc3RUb2tlbg== (example only).
  3. Final header:
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.

  • 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.


4. Practical “find & replace” steps

  1. Search for the old token:

    • In Service Studio, use Edit > Find in Module and search for part of the visible value (e.g. V67dfjkj2 that you see in the debugger).
    • This will show you exactly where it is defined (either in an Assignment or in a Site Property).
  2. Update it:

    • If it’s in an Assignment: replace the literal string with the new Basic <Base64> string.
    • If it’s in a Site Property: open the Site Property and replace the value there.
  3. Publish the module and test again:

    • Run the screen or action that triggers the REST integration.
    • Debug again and confirm Headers.Current.Value now contains the new header.

5. Optional: Make it safer/manageable

If it’s not already using a Site Property, this is a good moment to:

  • Create a Site Property AzureDevOpsAuthorizationHeader (or similar).

  • Set it to Basic <yourBase64PAT> in the environment.

  • 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.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
UserImage.jpg
Łukasz Kaproń

Hi @JayPea 

Can you show your full OnBeforeRequest action?

2023-12-26 10-35-28
OutSystems Neo
Staff
Solution by AI
AI Generated

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.

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.


1. How the Azure DevOps PAT should be sent

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:

  • Name: "Authorization"
  • Value: "Basic V29y..." (this is your old PAT encoded as Basic <base64 string>)

So you need to update this "Value" to use your new PAT.


2. Where the value is coming from

Open the OnBeforeRequest server action of the REST API:

  1. In Logic > Integrations > REST > [your AzureDevOpsConnector] > OnBeforeRequest, open the action.
  2. Look for assignments to:
    • Headers.List.Current.Value
    • or something like Headers.List[<index>].Value
    • or a loop over headers, adding an “Authorization” header.

Typical patterns:

A. Hard‑coded Authorization header

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).


B. Authorization value coming from a Site Property / Module variable

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:

  1. Check if there is a Site Property in the module (Data > Site Properties) with a name like:
    • AzureDevOpsPAT
    • DevOps_PAT
    • AzureDevOpsAuthHeader
  2. Open it and see if its value contains the string "Basic V29y...".
  3. Replace that value with your new encoded PAT string (again, see section 3).

If this is a Site Property, remember to:

  • Publish the module after editing.
  • Go to Lifetime (or Service Center) and ensure the Site Property value is updated in the environment (if you’re using different values per environment).

C. Authorization built dynamically each request

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.


3. Generating the correct Authorization header

Given your new PAT (for example: myNewPATToken), Azure DevOps expects:

  1. Concatenate ":" + PAT → ":myNewPATToken"
  2. Base64‑encode that string → e.g. ":" + PAT → OlRlc3RUb2tlbg== (example only).
  3. Final header:
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.

  • 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.


4. Practical “find & replace” steps

  1. Search for the old token:

    • In Service Studio, use Edit > Find in Module and search for part of the visible value (e.g. V67dfjkj2 that you see in the debugger).
    • This will show you exactly where it is defined (either in an Assignment or in a Site Property).
  2. Update it:

    • If it’s in an Assignment: replace the literal string with the new Basic <Base64> string.
    • If it’s in a Site Property: open the Site Property and replace the value there.
  3. Publish the module and test again:

    • Run the screen or action that triggers the REST integration.
    • Debug again and confirm Headers.Current.Value now contains the new header.

5. Optional: Make it safer/manageable

If it’s not already using a Site Property, this is a good moment to:

  • Create a Site Property AzureDevOpsAuthorizationHeader (or similar).

  • Set it to Basic <yourBase64PAT> in the environment.

  • 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.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2022-09-04 15-01-10
JayPea

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.