13
Views
1
Comments
Solved
[JWT Token] How do I get a JWT Token
Question
Forge component by Karnan M
0
Published on 28 Jul 2020

Is there a component I can use to get a JWT?  

I see there are 2 on offer - one has a full web interface and the other is an extension.  Neither use the fields I need. Can the extension be modified in any way for my fields or can I hook into the web interface directly from my app and create the ones I need?  If fields are left blank does this effect the token value?  The fields I need are (for example below).  

I can create the token manually and get connected successfully on the REST API.  But the token is only valid for 30 secs from the iat time so must be obtained programmatically.

Extension: JWT Token 
App:  JWT

Or is there another way of connecting to the JWT API to get the token?

Header:

{
  "typ": "JWT",
  "alg": "HS256"
}

Payload:

(iat is Epoch seconds)

{
  "iss": "26785a09-ab16-4eb0-8407-a37497a57506",
  "iat": 1568818578
}
Rank: #1127
Solution

I worked out how to do this by calling the JWT module server actions directly.