JWT access token

Answered

Comments

7 comments

  • Official comment
    Avatar
    Tony Ruth

    Hi Andrew, your payload is actually not built correctly.

    The "aud" parameter needs to be "https://app.iformbuilder.com/exzact/api/oauth/token" for the environment you are trying to work with.

     

    Hope that helps,

    Tony

    Comment actions Permalink
  • Avatar
    Andrew Leith

    Hi Tony,

    I have tried that already (you can see in the code sample above I've changed it to app.iformbuilder.com). Here is another JWT, still not working:

    eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NjU0MjU2NDYsImlhdCI6IjE0NjU0MjIwNDYiLCJpc3MiOiIzMzA2M2YwY2QzMWM2MjM4NjdiNTc1NDNjM2Q1MjdiYzRlODI4NDJmIiwiYXVkIjoiaHR0cHM6Ly9hcHAuaWZvcm1idWlsZGVyLmNvbS9leHphY3QvYXBpL29hdXRoL3Rva2VuIiwibmJmIjoxNDY1NDIyMDQ2fQ.jYjlej-RG0FyI65PfETYTli3dbWWRh33X00KZpogEc8

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrew Leith

    Perhaps I’m doing something wrong with the exp and iat values? I think I’m calculating them correctly from 1/1/1970 and using UTC, but I may not have it right.

    Also, the .net library I'm using (System.IdentityModel.Tokens.Jwt) includes an nbf value which I can't seem to get rid of.

    0
    Comment actions Permalink
  • Avatar
    Tony Ruth

    Hi Andrew, your last example has exp and iat difference of one hour. This won't work as the limit is 10 minutes and you also need to clean up the payload as it includes the extra parameter "nbf" as you mentioned.

    0
    Comment actions Permalink
  • Avatar
    Andrew Leith

    I have used the sample VB code provided by iFormBuilder, popped that in its own project and then I'm using that in my C# app. Its working OK now. I don't know what the difference is, and I don't really have the time to figure it out!

    0
    Comment actions Permalink
  • Avatar
    Tony Ruth

    Hi Andrew, can you share the post you are referencing for Visual Basic example? We don't use that internally, so I expect that is posted by another community member that might be able to provide some clarify for you.

    0
    Comment actions Permalink
  • Avatar
    Andrew Leith

    Its in the API code samples found here https://iformbuilder.zendesk.com/hc/en-us/articles/201989314--NET-Access-Token-generation-JWT-

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk