What is a simple way to create a JWT?

Follow

Comments

9 comments

  • Avatar
    David Tompos

    What changes for 6.0? I can't get a token using: https://servername.iformbuilder.com/exzact/api/v60/token

    Works fine for the old url.

  • Avatar
    Tony Ruth

    Hi David, the version only pertains to the application calls. The authentication requests are not versioned and you should continue using everything you have in place already for getting an access token.

  • Avatar
    Heinrich Langehoven

    Good day,

     

    "Grant type will always be equal to "urn:ietf:params:oauth:grant-type:jwt-bearer""

     

    Is this still true?

    I get  "error": "invalid_grant" when making requests.

    The program used to run 100%, its been off for a few months, but now its not working, cant get an access token.

     

     

  • Avatar
    Tony Ruth

    Hi Heinrich, yes that statement is still true. Can you confirm that your IAT and EXP are within the required tolerances (no greater than 10 minutes).

  • Avatar
    Heinrich Langehoven

    Hi again.

     

    Thanks for the response.

    I tried over and over again, but still no luck.

    I am in South Africa (UCT+2), do you think this could have any affect? Maybe the timezones dont match.

    I tried DateTime.Now - 2 hours, but still no luck.

  • Avatar
    Heinrich Langehoven

    Hi Tony,

    Thanks for your response.

    I tried many different approaches, no success.

    I am in South Africa (UCT+2).

    Do you think this affects anything

  • Avatar
    Heinrich Langehoven

    Lol, Sorry for the double message, had the first message type in another browser and thought I just closed it or something :P

     

  • Avatar
    Heinrich Langehoven

    Bombarding with messages, apologies.

     

    Found the problem, not quite sure where it is though...

     

    Our Time currently is 10:40, UCT is 8:40... However when I pull the UCT from Visual Basic i get 8:26... Not sure why.... 

    Anyway I added 20 minutes to the overall time, and get the access token..., Reallly cant explain what happened...

  • Avatar
    Tony Ruth

    Hi Heinrich, no worries on the questions.. more than happy to help. I am sure someone else will bump into this down the road as well.

    The change you made does make sense as the IAT and EXP are compared with current UTC time when sent to the server. When there is a mismatch as large as the window you found, it would not validate and come back with the invalid grant response.

    Glad to hear your integration is up and running again!

Please sign in to leave a comment.

Powered by Zendesk