- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 12:09 PM
I have a JWT Provider and I am generating JWT tokens using the GlideJWTAPI. The tokens generate fine but I only have one JSON value in my header variable but the generateJWT function adds an additional value. This value breaks authentication because the vendor server does not accept this value in the header.
var jwtAPI = new sn_auth.GlideJWTAPI();
var headerJSON = {"alg":"RS256"};
var header = JSON.stringify(headerJSON);
//...
//...
var jwt = jwtAPI.generateJWT(jwtProviderSysId, header, payload);
The base64 value that is generated by the generateJWT function is:
{"alg":"RS256","typ":"JWT"}
EDIT
Additionally, the payload value has a jti value added that I did not include:
{
"aud": "<url>",
"scope": "<string>",
"iss": "<issValue>",
"exp": 1643747002,
"iat": 1643746942,
"jti": "1c6683b9-3a47-4809-a5ec-5320c48a7b65"
}
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 02:25 PM
After further research, I determined that this particular vendor does not care if those extra values are present as long as the required values are still there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2025 08:40 AM
Did you get any help from ServiceNow on this? I'm seeing 'kid' added to the header section which breaks my authentication.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I did not... It's been a long time, so maybe something has changed since then in the OOB JWT configuration options, but I ended up having to build my own JWT token generator in a script include that I could use to make the connection. It was a huge hassle, but it did work eventually.
