Unable to provide basic auth for scripted rest API

eashwar
Tera Contributor

Hello,

I created a scripted REST API and selected requires authentication but unable to specify the basic auth credentials.

It does not show me an option to do it.

Any guidance ?

 

Thank you,

Easwar

1 ACCEPTED SOLUTION

Thats Correct. If you check the Requires Authentication checkbox, any user can get authenticated with correct credentials. It can be Basic or OAuth(Resource Owner Password Grant). The ACL security evaluates the Roles of the Authenticated user agains the Resource that is being accessed. In your case ITIL role users can access the resource. Also make sure user has other roles required to access the resource. If you are using a Service Account for this integration, make sure you check the Web Service Access only checkbox on the sys_user record for the service Account. https://community.servicenow.com/community?id=community_blog&sys_id=b4fca2a5dbd0dbc01dcaf3231f961900

View solution in original post

6 REPLIES 6

ARG645
Tera Guru

Easwar,

checking the requires authentication check box alone is enough. You dont get any options to choose basic Authentication Profiles.

If you want to dig into specifics, you can check the  Requires ACL authorization and select your ACL of type Rest_endpoint(In this ACL you can define Roles that are needed for the user who is trying to Authenticate using Basic Authentication)

Below link should help you.

Scripted REST API security matrix

 

eashwar
Tera Contributor

Thank you Aman,

Once we select requires authentication, which authentication credential is used to authenticate against the API.

Thats where i am confused.

 

Also for example.

If i am adding specific ACL for Scripted API which i created and providing ITIL role to create incident.

Can any user with ITIL role can access the API.

 

ServiceNow docs are not helping that much.

Thats Correct. If you check the Requires Authentication checkbox, any user can get authenticated with correct credentials. It can be Basic or OAuth(Resource Owner Password Grant). The ACL security evaluates the Roles of the Authenticated user agains the Resource that is being accessed. In your case ITIL role users can access the resource. Also make sure user has other roles required to access the resource. If you are using a Service Account for this integration, make sure you check the Web Service Access only checkbox on the sys_user record for the service Account. https://community.servicenow.com/community?id=community_blog&sys_id=b4fca2a5dbd0dbc01dcaf3231f961900

Hi @Aman Reddy Gurram 

Could it be OAuth but with grand type other then Resource Owner Password?

I'm trying to see if I can secure our Scripted Rest API with OAuth only.