CartJS not working in scripted REST API which does not use authentication

JosephAn
Tera Contributor

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?

2 REPLIES 2

Sanjay191
Tera Sage

Hello @JosephAn 
Could you please give me more reference about you script and all.

and what error we are getting.

Ankur Bawiskar
Tera Patron
Tera Patron

@JosephAn 

share your script and complete configuration screenshots.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader