401错误,用户名/密码正确时骡子



我正在尝试使用邮递员调用我用Mule部署的API。 我已从受信任的来源(Collibra(下载了此API,因此希望它处于工作状态。

API 请求:http://localhost:8081/connect/dgc/export/asset?filter=name%20STARTS_WITH%20E

下面是其中一个 xml 文件中的基本身份验证设置。

<mule-ss:security-manager name ="authenticationManager" doc:name="Spring Security Provider">
<mule-ss:delegate-security-provider
name="memory-provider" delegate-ref="authenticationManager-common" />
</mule-ss:security-manager> 
<spring:beans>
<ss:authentication-manager alias="authenticationManager-common">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="${service.user}" password="${service.password}"
authorities="ROLE_ADMIN" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>

这是属性文件中用户名/密码的设置。

service.user=user
service.password=password

当我使用正确的凭据发出邮递员 GET 请求时,会出现以下错误。

Failed to connect/reconnect: Work Descriptor. Root Exception was: Unexpected response with status code: 401 was returned. Message was: {"statusCode":401,"titleMessage":"Not authorized","userMessage":"The user name or password is wrong. Try again."}

这是我使用不正确的凭据时出现的错误。

Root Exception stack trace:
org.springframework.security.authentication.BadCredentialsException: Bad credentials

当我通过基本身份验证传递正确的凭据时出现错误可能会出错吗?我已经使用在线标头生成器仔细检查了字符串,它确实是正确的。

如果不了解 API 实现,就很难进行故障排除,但鉴于凭据不正确的错误似乎来自 Spring 安全管理器,并且使用正确的凭据,它似乎正在连接到其他内容,因此 API 可能正在调用某个后端系统或 API 并且无法对其进行身份验证。

最新更新