Authorization issue

Shabbir1
Tera Contributor

Hi 

 

I have created a GET API to fetch the all open incidents by using rest API explorer and I have created basic user account for authentication its working fine with POSTMAN we are getting results ..but the issue is for same API if we are using any other account in ServiceNow (user name and password) we are getting authentication error can anyone suggest how to achieve this sharing screen shot for reference

 

Shabbir1_0-1703217705745.png

 

 

Regards

shabbir 

8 REPLIES 8

Hi @Shabbir1 ,

 

It is possible but not recommended. If its just for testing purpose you can do it in lower environments. U can set the password from LIST view for the user account with whom u want to test & make sure u have provided necessary roles web_service_admin & rest_service, else it will not work.

 

Thanks,

Danish

 

 

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Shabbir1 ,

 

Agree with @Sainath N point normal Sso accounts will not work as they don't have the required roles. Whenever u create a service account for any api we need to provide web service role plus also check the web service account only on the user record so that it can be only used for API purpose n not for normal login.

 

Usually this roles are not given to any normal account hence u won't able to retrieve any data. Apart from admin account as it consist of all the roles.

 

Thanks,

Danish

 

Anil Lande
Kilo Patron

Make sure you are using correct cred.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Shabbir1 

 

Is it any specific reason you need SSO here, as SSO is something which is internal and a user access alot of tools /platform internals to organization. It can be risk as well .

 

And for integration Service Account with basis role is a good option.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************