Skip to main content
10-Marble
February 21, 2024
Question

Fetching NONCE Token

  • February 21, 2024
  • 1 reply
  • 1437 views

I am trying to fetch a NONCE Token so I can run HTTP requests in my command line to use the API. I am following:

VH_10947268_0-1708536860361.png

but it still says that my authorization has failed when I do a curl command with a GET request. Windchill 12.1.2.0, and REST 2.5

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
February 22, 2024

Hi @VH_10947268 

What authentication do you use? and how do you push the user and password in the request?

PetrH

10-Marble
February 22, 2024

I think I figured it out. I supply a -u to the curl, then my username and then it'll prompt me for my password and then it will then give me the NONCE token. What is the NONCE token for? It seems when I try to supply it, it tells me authentication failed anyways. Is there a way I can authenticate my terminal sessions so I don't have to supply the username and password everytime?

10-Marble
February 22, 2024

My understanding is that the NONCE token is used as an extra layer of security along with the normal form of authentication when using HTTP methods that change or delete data. It does not act as a replacement for your standard authentication method. 

 

Assuming you are using Basic authorization, you can base64 encode the value <username:password> and use that in the header of your requests.