Make contextual search results appear on a public facing record producer

anguspalmer
Giga Guru

I have a record producer that creates a Complaint Case. When logged in to the CSP portal the contextual search results work. However, for unauthenticated users the search results do not show.

I have made the record producer available to public (unauthenticated users) and allowed the Consumer knowledge base to be viewed by the public too.

The browser console reports the following error.

find_real_file.png

Anyone know how to allow public access to contextual search?

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

hello,

Jut to be sure have you made everything public right?

The Page on which the widget is?

The widget itself?

Source of the knowledge?

Also you can check the below article from the Hi support team

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551300

Please mark answer correct/helpful based on Impact.

anguspalmer
Giga Guru

The page, catalog item and knowledge base are all publicly available. I can confirm that by navigating to the Consumer Service Portal `/csp` . From there I can search and view the KB Articles via the Knowledgebase page `/csp?id=kb_search` and I can navigate to the Record producer.

I can also confirm that when I navigate to this URL (when authenticated) I see the Consumer knowledge base listed as publicly available. https://xxx.service-now.com/get_public_knowledge_bases

Only when I begin to enter text into the Summary field the contextual search result API is called; `POST /api/now/cxs/search` and I see 'unauthorised' in the browser's console.

 

This is a relatively straight forward fix. You need to modify the Scripted REST API for the "api/now/cxs" URL mentioned in the 401 error.

 

Go to System Web Service > Scripted Web Services > Scripted REST APIs

Search under "Base API Path" for "*cxs"

Open the Contextual Search (Internal API) record

In the Resources related list, open the "search" record with POST as HTTP method

Uncheck Requires Authentication under the security section of the form

 

This will remove need for authentication for that API call the contextual search does and returns records as expected for your record producer's contextual search.

Erin Nestor
Tera Contributor

Any resolution to this? I am also facing the same issue. I attempted to update the access on the contextual search endpoint and it did not work.