How to redirect unauthenticated users to login for restricted knowledge articles from the kb_view.do page?

Steve Kelly
Mega Sage

Hello Community,

We have a mix of public and restricted KB articles in our Knowledge Base. We have successfully implemented a redirect to authenticate when an unauthenticated user tries to access a restricted knowledge article on our service portal (the default behavior is an 'Article not found' error which is not user friendly). However, has anyone been able to do this in the native UI by modifying the kb_view.do page?

I haven't used Jelly too much so I'm not very familiar. I see ServiceNow has implemented this for their own Hi portal, so I may end up asking on Hi if I can't find an answer here.

Cheers,

Steve

12 REPLIES 12

shill
Mega Sage

We did this for reporting by using this format in the URL, but we are using saml.

https://<instance_name>.service-now.com/saml_redirector.do?sysparm_uri=/sys_report_template.do?jvar_report_id=<sys_id of report>" 

Might take a look at sys_public. There seems to be several authentication type pages that may work the same way as this if you do not use saml.

Thanks, that's a nice workaround for it. We also use SAML, but I would like the page to redirect if users share a regular KB URL and the article is restricted.

Community Alums
Not applicable

@stevekellyau Any chance you could share your code/what you did for the redirects?

" implemented a redirect to authenticate when an unauthenticated user tries to access a restricted knowledge article on our service portal"

 

We are running into the exact same issue, and can't figure out a clean way to force the redirect on either the portal or kb_view.do

Hi Lee,

Yeah absolutely. Which widget do you need the redirect code for? We were originally using the 'KB Article Page' widget but then moved to the 'Knowledge Article Content' widget. The customization steps are much easier for the former, more difficult for the latter.

We unfortunately did not get the redirect working for the kb_view.do page, but I did create an Idea for this functionality being available OOB on the SN Idea portal so please upvote!
https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=0c0f039fdb370c185129a851ca96...

Thanks,

Steve