2

I have the following piece of code which authenticates the registered user in ServiceNow via webservice call.

HttpTransportProperties.Authenticator basicAuthentication = new   HttpTransportProperties.Authenticator();
           basicAuthentication.setUsername("username");
           basicAuthentication.setPassword("password");
options.setProperty(
                    org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
                    basicAuthentication);
options.setProperty(
                    org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
                    Boolean.FALSE);

But it doesn't authenticate the user, instead I am getting an exception that says "Insufficient rights to create new records". Couldn't find a solution for this even in service now community pages. Could it be a problem with the code or the ServiceNow instance that I am using? Any help is appreciated.

Thanks

Note: Along with the above code, I even have the code to create the incident which is not mentioned here.

Deepak
  • 111
  • 9

2 Answers2

1

The message you're seeing is not telling you that authentication failed, just that the user as whom you are authenticating lacks sufficient privilege to do what you're trying to do.

The solution depends on the configuration of the instance hosting the direct web service you're consuming. This wiki article overviews all of the potential causes of your insufficient access.

If your user can create records interactively (in the UI), my guess is that your user lacks the special SOAP roles which allow SOAP activity. From the referenced wiki: 5 Web Service User Roles

5 Web Service User Roles

When basic authentication is required for web services, enabling the glide.soap.strict_security property validates the authenticated SOAP user with Contextual Security as well as validates the SOAP action with the user assigned roles. The following roles are available for securing any inbound SOAP requests:

The roles table is here, give yourself the soap role in the ServiceNow instance, and you should be good.

Community
  • 1
  • 1
Joey
  • 2,901
  • 21
  • 22
  • Thanks for replying. As u said, I can create tickets in UI, and I do Have all the soap rules, like soap_create, soap_query, soap_update. . . and still I am unable to create or read any incident. – Deepak May 29 '14 at 17:28
  • If you have the "soap_create" role, the only other thing that is checked is ACLs on the table for the attempted operation, so if you can read/create in the UI, you should be working. What version of ServiceNow is your instance running (you can get it from /stats.do)? – Joey May 29 '14 at 17:41
  • Sorry if I'm being ignorant. build name and build tag are the only relevant content I could see which are 'Calgary' and 'glide-calgary - 02-15-2013-_cca4-04-19-2013' respectively. – Deepak May 29 '14 at 18:03
  • 2
    That's exactly what I'm looking for. You're running the version "Calgary CCA4", I'm looking at a much newer version that potentially may not be exhibiting the same behavior you're seeing. You may want to go to the ServiceNow community and ask for help there, or, log an incident with ServiceNow support. This may be a known problem or something unique to your configuration that requires someone to login to your system and look around, a diagnostic step that you probably don't want to farm out to some jerks on StackOverflow :) – Joey May 30 '14 at 17:39
0

I couldn't find an answer for this question in service now community as well. Eventually I had to start working with another instance. Hence I believe this is a problem with the service now. let this be useful for anyone who comes across this problem.

Deepak
  • 111
  • 9