Pub.client:http and personnal access token

Hi,
I try to connect to azureDevOps site with a http post request.
I create a PAT (Personnal Access Token) on AzureDevOps and according to Microsoft I have to write somethiing like
Basic authorization Username = Blank and Password = My PAT encore in base 64 (I use pub.string:base64Encode for this).
So I thought I have to write in auth document (in post service), Type = Basic and pass = PAT.

I test it on Postman and like this (witjout converting my PAT in base 64), it works. (I guess Postman make a implicit conversion I don’t know).

In webMethods when I try I have an error 203 with message = Non-authoritative information.
(I try without converting in base 64 and I have the same error).

I don’t know how to solve my problem

It looks like it is just expecting HTTP Basic auth with no username

If so, set:

auth/type = Basic
auth/user blank or empty string
auth/pass = your PAT

webMethods should send the correctly encoded Authorization header

Hi Dave,
Thanks to take the time to answer me.
But as I said upper, what you suggest is exactly what I did. But it seems to not work (http error 203, look like a authentification issue). And it is not a incorrect token given to the request because same request is done on Portman and request give me an answer (http 200)

Try passing the Authorization as a header param in pub.client.http. Copy the field value from postman. You can get this from Headers tab in postman.

Regards,
S.

1 Like

Hi smathangi,
Thanks for your answer. I tried this méthod to without success

Hi Vital,

Can you copy the base64String from webMethods and use the same to pass it from Postman and see if that works as well? Might be you get 203 there as well.

Just to know if this is an actual token without base64 that works through postman or all.

Regards,
Firoz N

Hi Firoz,
Something should exists in Postman because when I encode in base 64 in Postman, I have the 203 http error. The token in Postman must to not be encoded. It is not the same behaviour in webMethods because without encoding the token, I have the 203 http error.
I try on webMethods using pub.string:base64Encode and even a encode online translator. (Because I’m not familiar with the Base 64 encode) and I have the same encryption. And if I use it, I have the http 203 error.
And if I use Postman (look at the header in response in postman) for using the authorization parameter and use it as token encoded, I haven’t the same translation but if I use it, I have still the http 203 error code.

Hi Vital,

Would you mind to share us the working Postman request’s ‘HTTP Code Snippets’ output? That would give us additional hint on what the Postman is actually sending.

Please keep the actual HTTP Header names; feel free to obfuscate the values.

In my sceen,
I put the password (in Basic Auth as define here (and let user as blank) and I stille have the 203 http error code

Vital,

Looks like there is no extra headers in the request.

Additionally, HTTP Status Code 203 shouldn’t mean error at all.
The standard says that HTTP Status Code 203 just means “Non-authoritative Information” - google around for “HTTP Status Code”. In other words, means the request has been successfully processed (all return codes of the 2xx-class means that) .

I noticed that the request contains a cookie, which makes me wonder if it makes any difference at all, since plain pub.client:http doesn’t have any cookies - unless you set it. And that might be the difference.

Hi Feng,
You’r right about 203 error code.
The problem is if I gavie awrong token on Postman or even if I encode in 64 base the token in Postman, I have a http 203 error code. Sor for me it’s a Failure. Even if it seems to not be a good error from AzureDevOps site.
I didn’t use cookie.
I Wonder if pub.client:http create the : in Header when we make a Basic auth.
Something like Authorization: Basic :PAT instead of Authorization: Basic PAT

Vital,

A note here about Postman: you should not need to encode the password to have it corrently sent out; the standard [of the Basic Auth] specifies so.
Having this said, neither in webMethods you have to encode the password [to have it sent correctly in the Authorization].
The standard specifies that the user and password should be encoded, and both Postman and IS complies to that spec [and all the other tools do as well] .

1 Like

Feng thanks,

Actually I tried the two methods in IS : encoding the PAT and let it as it is. In the two cases, the 203 error code appears.
For user, MS said to let in blank and I do that in Postman. I do it on IS to but I have doubt about the http service if it does it correctly.

OK,
I confirm something is wrong in auth document in http service.
I use the Authorization headers in postman to change my headers document in http service and not fill the auth document and that work’s : http 200