Hi Community,
I am trying to generate a JWT using createtokenwithsecretkey() in JWT plugin (using HS256). When I use the generated token and hit the Tableau signin API, I get signin error and JWT is invalid ( details error code: 10083).
However, I use the same parameter details in a python code and use the token generated, the API returns me a successful response. Can anyone help me with the issue on Appian side please?
createtokenwithsecretkey( externalSystemKey: "jwt", /*Set the third party credentials in Admin Console */ iss: <tableau connected apps clientID>, aud: "tableau", typ: "JWT", /*jti: fn!generateuuid(123),*/ exp: 43200 )
Discussion posts and replies are publicly visible
I had similar issues in the past. The problem was with the key. That key can bei either as text, base64 encoded, or a binary representation. And the Appian plugin only works with one variant. I had downloaded the plugin and checked the source code to find out what exactly is going on.
After some trial and error I had it working.
Additional hint - passing arguments by position is required for Appian custom function plug-ins (https://docs.appian.com/suite/help/23.2/passing-arguments.html#by-position). You might be missing alg as the 3rd argument, have typ and aud swapped, and have jti commented out.
oh Wow! I missed that completely! Fixed it and still working on the format. I can clearly see the base64 Python code uses is definitely different from what Appian plugin is creating. I don't have access to the source code of the plugin, checking for any available git for that plugin. Will post if I could fix it. Meanwhile any hints and guidance is appreciated. Thank you for all your support.
The source code will be in the jar if you download the package directly from the AppMarket
I am confused! I was searching for the plugin JWT and do not find in App Market outside the plugins page. I either find JWT Tools or JWT functions however, none of them has the function I am using, Apparently, in Appian when I am trying to use, the function comes as part of JWT functions however, I added only JWT in plugins and registered that in third party... Its a little confusing how the plugins are maintained and it would have been useful if we had a central code repo for all the plugins. When I use other JWT Functions that are listed, the registered third party would not work!
If possible, Can you please direct me to the page where I can download the code?
Thank you.
I found a download https://community.appian.com/b/appmarket/posts/jwt-web-token-tools#
the overview does not list the function I am using though! for JWT functions, I could not find the download.
That looks like the right one. The function name is missing from the web page, but is in the download PDF and jar.