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.