JWT - Generating Token

0
Using the JWT marketplace model, I'm trying to generate the JWT auth bearer token for a REST Service (Target API Authentication - CData Connect Cloud), however an unauthorized error is returned.     I updated the JWT object to hold the tokenType payload but was still getting an unauthorized error.  I tried updating the iat / exp data type to long and manually setting the values and this resulted in a Java Action datatype error.     When hitting the API through postman, I can successfully authenticate since the JWT is handled by postman.  I can then grab that token and hardcode it into the Mendix REST Services activity and successfully able to make the call.  
asked
1 answers
0

Hi Jeremy,

JWTs expect iat (issued at) and exp (expiration) as integers in Unix time format. This format counts seconds since 1970-01-01T00:00:00Z and is usually represented as a Long or Integer, not as a DateTime object. APIs expecting JWTs will look for integer values for these fields.

 

you can change the type of iat and exp in long or int in entity use microflow to calculate Generate Unix Timestamp in seconds.

 

Thanks,

Arun

answered