The CreatorCon Call for Content is officially open! Get started here.

How to use Azure DevOps Personal Access Token as an authentication type in REST API

Swapna Abburi
Mega Sage
Mega Sage

Hi,

I am trying to use REST API to create a work item in Azure DevOps from ServiceNow. The API works fine using Personal Access Token(PAT) in postman. Any idea how I can use PAT as an authentication type in ServiceNow Outbound REST message.

1 ACCEPTED SOLUTION

Swapna Abburi
Mega Sage
Mega Sage

It worked by creating a Basic Authentication credentials in ServiceNow with User Name as my AD/Network ID and password as Azure Personal Access Token (PAT).

View solution in original post

10 REPLIES 10

Swapna Abburi
Mega Sage
Mega Sage

It worked by creating a Basic Authentication credentials in ServiceNow with User Name as my AD/Network ID and password as Azure Personal Access Token (PAT).

Hi Swapna,

 

Hope you are doing well!!!

I need to achieve the same thing. Can you please help with the info that what do you mean by 'setting the username with AD/Network ID" does that mean the username on ServiceNow side should be the token name of the PAT from azure devOps side.

 

 

Thanks in advance,

Aindrila

Hi @Swapna Abburi 

 

Thank you for your insight, i have tried as you said like user name is AD and password is PAT, its worked fines, however after 30 days i tried to create incident in servicenow , did not reflect into azure devops work item because of PAT(token) has expired .how can i refresh token  automatically as soon as its expired .did you have any  token expired issue by any chance.

@anitha0887 
Usually Personal access token has a shorter validity. Once it is expired, a new one has to be created. I used PAT only during POC. Later, I switched the authentication using OAuth configuration which has 2 years Validity for client secret. Hope this information helps.