Discussions

 View Only
  • 1.  Incoming JSON or Incoming Request JWT Token

    Posted 03-16-2023 18:09

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


  • 2.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-22-2023 16:38

    Same here, tried RS256 and RS512.  



    ------------------------------
    Jason Gordon
    ------------------------------



  • 3.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-23-2023 14:01

    Hi Brian, 

    My technical team was able to solve this - the clue was in the image linked below from the JSON listener documentation. These fields need to be included in the payload when you generate the token. 

    https://helpv2.quickbase.com/hc/article_attachments/10661523058964

    Hope that helps - let me know



    ------------------------------
    Jason Gordon
    ------------------------------



  • 4.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 13:51

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



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



  • 5.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 14:17

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



  • 6.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 14:27

    At this time, I am just trying to do proof of concept as well. In the example above you added the private key and public key in the respective locations in QuickBase and postman? What tool did you use to generate your key pair?



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



  • 7.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 14:27



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



  • 8.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 14:30



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



  • 9.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 03-27-2023 14:49

    For ours I believe the method on QB side was "post". 

    The terminal commands I used on my mac to generate keys are: 

    1. openssl genrsa -out private.pem 2048
    2. openssl rsa -in private.pem -pubout > public.pem

    I used jwt.io to validate before sending to quickbase - if that side doesn't recognize the token as valid quickbase won't either. 



    ------------------------------
    Jason Gordon
    ------------------------------



  • 10.  RE: Incoming JSON or Incoming Request JWT Token

    Posted 04-11-2023 19:47

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