Cannot configure JWT based authentication for inbound API calls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 11:44 PM
I am trying to integrate a custom internal application which is to get data from Service Now. The data I am trying to get is being fetched by Table APIs.
Currently I have enabled authentication using grant type as password. I supply a Client ID, user name, passwords for the same to the table API and this works.
But I need to change to JWT based authentication. I referred to the product documentation available at https://docs.servicenow.com/bundle/vancouver-platform-security/page/administer/security/task/create-... .
We completed all actions listed in Step #2 Set up the configuration in your ServiceNow instance to verify the incoming JWT.
In Step #3 Send a cURL request containing the JWT token to obtain an access token from your instance. Here we are asked to pass a string value for assertion. The document does not explain how to generate the assertion token. Please help me know how assertion value can be generated. Any links to the available documentation will also help.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 07:21 PM - edited 01-17-2024 07:24 PM
You will need to use an external library to create the assertion.
Refer to something like below:
https://pyjwt.readthedocs.io/en/latest/
https://stackoverflow.com/questions/56437612/how-to-generate-jwt-assertion-in-python
You can also do it using node.js with the jsonwebtoken package.
Please accept solution OR mark helpful.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:14 PM
Take a look at this article. This one has a better explanation.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1275215
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 06:17 AM
Hi Niamul,
In this instance it appears that the JWT assertion is being generated by the provider ServiceNow Instance and then shared with the client. Does that mean that the JWT always has to be generated on instance? Or is there some way to share the secret so the client can generate the assertion themselves?
Thanks!