gpt4 book ai didi

java - 在 ServiceNow 中创建新记录的权限不足(基本身份验证不起作用)

转载 作者:行者123 更新时间:2023-11-30 11:18:15 26 4
gpt4 key购买 nike

我有以下代码通过网络服务调用对 ServiceNow 中的注册用户进行身份验证。

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);

但它不会对用户进行身份验证,相反我会收到一个异常,提示“创建新记录的权限不足”。即使在 service now 社区页面中也找不到解决方案。可能是我使用的代码或 ServiceNow 实例有问题吗?感谢您的帮助。

谢谢

注意:除了上面的代码,我什至还有创建这里没有提到的事件的代码。

最佳答案

您看到的消息并没有告诉您身份验证失败,只是您作为其身份验证的用户没有足够的权限来执行您正在尝试执行的操作。

解决方案取决于托管您正在使用的直接 Web 服务的实例的配置。 This wiki article概述了您的访问权限不足的所有潜在原因。

如果您的用户可以交互方式创建记录(在 UI 中),我的猜测是您的用户缺少允许 SOAP Activity 的特殊 SOAP 角色。来自引用的维基:5 Web 服务用户角色

5 Web Service User Roles

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

角色表是here ,在 ServiceNow 实例中给自己 soap 角色,你应该很好。

关于java - 在 ServiceNow 中创建新记录的权限不足(基本身份验证不起作用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23934045/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com