Need help to generate the JWT Token using P8 file and Passphrase
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 10:34 PM
Dear All,
Need help. I am currently working on a scenario where I need to fetch data from Snowflake. They don’t have Oauth for authentication, but they have provided a certificate file with a .p8 extension and a Passphrase. Using a Python script, I have successfully generated a JWT token with the .p8 certificate and Passphrase and have been able to call the Snowflake API by passing the JWT token as the bearer token. Consequently, I can fetch table/view data in the response. I have managed to configure the above setup in Postman without any issues.
However, I am now looking to replicate this setup in ServiceNow. Unfortunately, I haven't found any options within ServiceNow to generate the JWT token using .p8 certificates and Passphrase. Could you please assist me in implementing the above configuration in ServiceNow?
Your help would be greatly appreciated.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2026 08:29 PM
Hi Jitesh,
No.
I am looking for the solution.
Thanks
Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
No
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
To generate a JWT Token using a P8 file and passphrase in ServiceNow, follow these steps:
-
Upload the Java Key Store (JKS) certificate:
- Go to All > Multi-Provider SSO > x509 Certificate.
- Fill in the form, upload your certificate, and provide the keystore password (your passphrase). Submit the form.
-
Configure a JWT signing key:
- Navigate to All > System OAuth > JWT Keys.
- Create a new JWT signing key, assign it to your uploaded keystore, specify the Key ID (optional), select RSA 256 as the signing algorithm, and enter the signing key password (your passphrase). Submit the form.
-
Create a JWT provider:
- Go to All > System OAuth > JWT Provider.
- Add a new provider, set the expiry interval, and select your signing configuration (the JWT signing key you just created). Submit the form.
-
Generate the JWT Token using the API:
- Use the following sample script: var jwtAPI = new sn_auth.GlideJWTAPI(); var headerJSON = { "kid": "a1234" }; var header = JSON.stringify(headerJSON); var payloadJSON = { "jti": "testjti", "iss": "testiss", "sub": "testsub" }; var payload = JSON.stringify(payloadJSON); var jwtProviderSysId = "your_jwt_provider_sys_id"; var jwt = jwtAPI.generateJWT(jwtProviderSysId, header, payload); gs.info("JWT:" + jwt);
- Replace "your_jwt_provider_sys_id" with the Sys ID of your JWT provider
This process enables secure JWT token generation for server-to-server authentication using your P8 file and passphrase.
