Forum Discussion

BrianCrowther's avatar
BrianCrowther
Qrew Trainee
2 years ago

Incoming JSON or Incoming Request JWT Token

I am using postman to test API connections to Quickbase Post, create new record. I can post and create a new record with fields populated correctly using basic or no authentication. As soon as I try to use a JWT Token, I get an "error": "Unauthorized" in postman and no action on the Quickbase side, not even an error that an attempt was made. Does anyone have a good test setup that I can work with that was successful using postman or another API testing platform?

Using RS256 Public and Privet Key.



------------------------------
Brian Crowther
------------------------------

9 Replies

  • Same here, tried RS256 and RS512.  



    ------------------------------
    Jason Gordon
    ------------------------------
    • BrianCrowther's avatar
      BrianCrowther
      Qrew Trainee

      Jason did your team use postman for testing or something else?



      ------------------------------
      Brian Crowther
      ------------------------------
      • JasonGordon's avatar
        JasonGordon
        Qrew Member

        Yes - we used postman but only to be able to develop a proof of concept. I had to update Postman for "JWT Bearer" to be an option in the Authorization tab. 

        Unfortunately I wasn't signed in & lost the example: for us the turning point was adding those fields from the screenshot I mentioned to the payload section down below. 



        ------------------------------
        Jason Gordon
        ------------------------------
  • After a lot of chasing my own tail, I was able to make this work on a windows computer with openssl and postman.
    1. Install openssl
    2. Create a folder that you will work in. I named mine RSAQBkey.
    3. Run 2 commands under that directory.
    4. openssl genrsa -out private-key.pem 3072
    5. openssl rsa -in private-key.pem -pubout -out public-key.pem
    6. you will now have two new files in the folder. private-key.pem, and public-key.pem.
    7. open the file in notepad and copy and past in quickbase.
    8. post private key in postman with the payload. Notice the payload of first:Ham and Last:Burger. This is what will post to my DB.
    Must be in payload or it will not work. Then add to the payload as needed for what you need to post or modify.

    9 You will need to look at the post and look for the correct syntax for use in your pipeline under create or modify record. For me it is {{a.jwt_payload.last}}
    10. Observation of running pipeline.
    I hope this is clear to anyone who reads it later. I know it was a struggle to get it to work for me for testing. Now that I have this base information, I can post, change, etc, information from a web form.



    ------------------------------
    Brian Crowther
    ------------------------------