CartJS not working in scripted REST API which does not use authentication
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2025 10:40 PM
I have a scripted REST API that creates Service Request Items, and we're using CartJS to add the requested items. Previously, we used basic authentication, but now we've switched to JWT tokens. The client now sends a JWT token, and in the script, we check the token's authority to grant access to the API.
As part of this change, we unchecked the "Require Authentication" box for this specific scripted REST API. Everything works fine with basic authentication, but when we use a JWT token, the cart submission throws an error and nothing gets created.
Is there a way to use CartJS with a scripted REST API that doesn't require authentication?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2025 12:40 AM
Hello @JosephAn
Could you please give me more reference about you script and all.
and what error we are getting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2025 01:05 AM
share your script and complete configuration screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader